From b10924cde1c46e5b4ac0ee2a7c49ddaf079175fe Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 15 Apr 2025 04:14:39 +0000 Subject: [PATCH] CodeGen from PR 33751 in Azure/azure-rest-api-specs Merge 52db3e7e856ec61a00e0026a957286fbfb87739c into 9db97082212bc1bb0f428681766d69a9e8a7435d --- sdk/cosmos/azure-mgmt-cosmosdb/CHANGELOG.md | 10 + sdk/cosmos/azure-mgmt-cosmosdb/README.md | 2 +- sdk/cosmos/azure-mgmt-cosmosdb/_meta.json | 6 +- .../azure/mgmt/cosmosdb/_configuration.py | 8 +- .../cosmosdb/_cosmos_db_management_client.py | 54 +- .../azure/mgmt/cosmosdb/_serialization.py | 16 +- .../azure/mgmt/cosmosdb/_version.py | 2 +- .../azure/mgmt/cosmosdb/aio/_configuration.py | 8 +- .../aio/_cosmos_db_management_client.py | 54 +- .../mgmt/cosmosdb/aio/operations/__init__.py | 16 - .../_cassandra_clusters_operations.py | 505 +- .../_cassandra_resources_operations.py | 1054 - .../aio/operations/_chaos_fault_operations.py | 413 - .../_data_transfer_jobs_operations.py | 589 - .../_database_accounts_operations.py | 4 +- .../operations/_graph_resources_operations.py | 543 - .../_mongo_db_resources_operations.py | 1654 +- ...ity_perimeter_configurations_operations.py | 340 - .../_notebook_workspaces_operations.py | 14 +- ...private_endpoint_connections_operations.py | 4 +- .../aio/operations/_service_operations.py | 9 +- .../operations/_sql_resources_operations.py | 2348 +- .../operations/_table_resources_operations.py | 980 +- .../_throughput_pool_account_operations.py | 459 - .../_throughput_pool_accounts_operations.py | 141 - .../operations/_throughput_pool_operations.py | 639 - .../_throughput_pools_operations.py | 215 - .../azure/mgmt/cosmosdb/models/__init__.py | 180 +- .../_cosmos_db_management_client_enums.py | 173 +- .../azure/mgmt/cosmosdb/models/_models_py3.py | 19128 +++++++--------- .../mgmt/cosmosdb/operations/__init__.py | 16 - .../_cassandra_clusters_operations.py | 734 +- .../_cassandra_data_centers_operations.py | 20 +- .../_cassandra_resources_operations.py | 1399 +- .../operations/_chaos_fault_operations.py | 523 - .../operations/_collection_operations.py | 12 +- .../_collection_partition_operations.py | 8 +- ..._collection_partition_region_operations.py | 4 +- .../_collection_region_operations.py | 4 +- .../_data_transfer_jobs_operations.py | 836 - .../_database_account_region_operations.py | 4 +- .../_database_accounts_operations.py | 74 +- .../operations/_database_operations.py | 12 +- .../operations/_graph_resources_operations.py | 679 - .../_gremlin_resources_operations.py | 68 +- .../operations/_locations_operations.py | 8 +- .../_mongo_db_resources_operations.py | 1988 +- ...ity_perimeter_configurations_operations.py | 461 - .../_notebook_workspaces_operations.py | 42 +- .../mgmt/cosmosdb/operations/_operations.py | 2 +- .../_partition_key_range_id_operations.py | 4 +- ...artition_key_range_id_region_operations.py | 4 +- .../operations/_percentile_operations.py | 4 +- .../_percentile_source_target_operations.py | 4 +- .../_percentile_target_operations.py | 4 +- ...private_endpoint_connections_operations.py | 20 +- .../_private_link_resources_operations.py | 8 +- ...restorable_database_accounts_operations.py | 12 +- ...restorable_gremlin_databases_operations.py | 4 +- .../_restorable_gremlin_graphs_operations.py | 4 +- ...restorable_gremlin_resources_operations.py | 4 +- ...storable_mongodb_collections_operations.py | 4 +- ...restorable_mongodb_databases_operations.py | 4 +- ...restorable_mongodb_resources_operations.py | 4 +- .../_restorable_sql_containers_operations.py | 4 +- .../_restorable_sql_databases_operations.py | 4 +- .../_restorable_sql_resources_operations.py | 4 +- .../_restorable_table_resources_operations.py | 4 +- .../_restorable_tables_operations.py | 4 +- .../operations/_service_operations.py | 25 +- .../operations/_sql_resources_operations.py | 2770 +-- .../operations/_table_resources_operations.py | 1292 +- .../_throughput_pool_account_operations.py | 616 - .../_throughput_pool_accounts_operations.py | 183 - .../operations/_throughput_pool_operations.py | 795 - .../_throughput_pools_operations.py | 270 - .../chaos_fault_enable_disable.py | 51 - .../generated_samples/chaos_fault_get.py | 43 - .../generated_samples/chaos_fault_list.py | 43 - ...mos_db_cassandra_keyspace_create_update.py | 2 +- .../cosmos_db_cassandra_keyspace_delete.py | 2 +- .../cosmos_db_cassandra_keyspace_get.py | 2 +- .../cosmos_db_cassandra_keyspace_list.py | 2 +- ...cassandra_keyspace_migrate_to_autoscale.py | 2 +- ...a_keyspace_migrate_to_manual_throughput.py | 2 +- ...os_db_cassandra_keyspace_throughput_get.py | 2 +- ...db_cassandra_keyspace_throughput_update.py | 2 +- ...cosmos_db_cassandra_table_create_update.py | 3 +- .../cosmos_db_cassandra_table_delete.py | 2 +- .../cosmos_db_cassandra_table_get.py | 2 +- .../cosmos_db_cassandra_table_list.py | 2 +- ...db_cassandra_table_migrate_to_autoscale.py | 2 +- ...ndra_table_migrate_to_manual_throughput.py | 2 +- ...osmos_db_cassandra_table_throughput_get.py | 2 +- ...os_db_cassandra_table_throughput_update.py | 2 +- .../cosmos_db_cassandra_view_create_update.py | 54 - .../cosmos_db_cassandra_view_delete.py | 43 - .../cosmos_db_cassandra_view_get.py | 44 - .../cosmos_db_cassandra_view_list.py | 44 - ..._db_cassandra_view_migrate_to_autoscale.py | 44 - ...andra_view_migrate_to_manual_throughput.py | 44 - ...cosmos_db_cassandra_view_throughput_get.py | 44 - ...mos_db_cassandra_view_throughput_update.py | 45 - ...os_db_collection_get_metric_definitions.py | 2 +- .../cosmos_db_collection_get_metrics.py | 2 +- .../cosmos_db_collection_get_usages.py | 2 +- ...mos_db_collection_partition_get_metrics.py | 2 +- ...smos_db_collection_partition_get_usages.py | 2 +- ...collection_partition_region_get_metrics.py | 2 +- .../cosmos_db_data_transfer_service_create.py | 2 +- .../cosmos_db_data_transfer_service_delete.py | 2 +- .../cosmos_db_data_transfer_service_get.py | 2 +- ...s_db_database_account_check_name_exists.py | 2 +- .../cosmos_db_database_account_create_max.py | 6 +- .../cosmos_db_database_account_create_min.py | 2 +- .../cosmos_db_database_account_delete.py | 2 +- ...tabase_account_failover_priority_change.py | 2 +- .../cosmos_db_database_account_get.py | 2 +- ...database_account_get_metric_definitions.py | 2 +- .../cosmos_db_database_account_get_metrics.py | 2 +- .../cosmos_db_database_account_get_usages.py | 2 +- .../cosmos_db_database_account_list.py | 2 +- ...database_account_list_by_resource_group.py | 2 +- ...atabase_account_list_connection_strings.py | 2 +- ...e_account_list_connection_strings_mongo.py | 2 +- .../cosmos_db_database_account_list_keys.py | 2 +- ...db_database_account_list_read_only_keys.py | 4 +- ...smos_db_database_account_offline_region.py | 2 +- ...osmos_db_database_account_online_region.py | 2 +- .../cosmos_db_database_account_patch.py | 8 +- ...smos_db_database_account_regenerate_key.py | 2 +- ..._db_database_account_region_get_metrics.py | 2 +- ...smos_db_database_get_metric_definitions.py | 2 +- .../cosmos_db_database_get_metrics.py | 2 +- .../cosmos_db_database_get_usages.py | 2 +- ...mos_db_graph_api_compute_service_create.py | 2 +- ...mos_db_graph_api_compute_service_delete.py | 2 +- ...cosmos_db_graph_api_compute_service_get.py | 2 +- .../cosmos_db_graph_resource_create_update.py | 48 - .../cosmos_db_graph_resource_delete.py | 42 - .../cosmos_db_graph_resource_get.py | 43 - .../cosmos_db_graph_resource_list.py | 43 - ...osmos_db_gremlin_database_create_update.py | 2 +- .../cosmos_db_gremlin_database_delete.py | 2 +- .../cosmos_db_gremlin_database_get.py | 2 +- .../cosmos_db_gremlin_database_list.py | 2 +- ...b_gremlin_database_migrate_to_autoscale.py | 2 +- ...n_database_migrate_to_manual_throughput.py | 2 +- ...smos_db_gremlin_database_throughput_get.py | 2 +- ...s_db_gremlin_database_throughput_update.py | 2 +- ...mos_db_gremlin_graph_backup_information.py | 2 +- .../cosmos_db_gremlin_graph_create_update.py | 2 +- .../cosmos_db_gremlin_graph_delete.py | 2 +- .../cosmos_db_gremlin_graph_get.py | 2 +- .../cosmos_db_gremlin_graph_list.py | 2 +- ...s_db_gremlin_graph_migrate_to_autoscale.py | 2 +- ...mlin_graph_migrate_to_manual_throughput.py | 2 +- .../cosmos_db_gremlin_graph_throughput_get.py | 2 +- ...smos_db_gremlin_graph_throughput_update.py | 2 +- .../cosmos_db_location_get.py | 2 +- .../cosmos_db_location_list.py | 2 +- .../cosmos_db_managed_cassandra_backup.py | 43 - ...osmos_db_managed_cassandra_backups_list.py | 43 - ...mos_db_managed_cassandra_cluster_create.py | 4 +- ...db_managed_cassandra_cluster_deallocate.py | 4 +- ...mos_db_managed_cassandra_cluster_delete.py | 2 +- ...cosmos_db_managed_cassandra_cluster_get.py | 2 +- ...assandra_cluster_list_by_resource_group.py | 2 +- ..._cassandra_cluster_list_by_subscription.py | 2 +- ...smos_db_managed_cassandra_cluster_patch.py | 2 +- ...smos_db_managed_cassandra_cluster_start.py | 4 +- .../cosmos_db_managed_cassandra_command.py | 6 +- ...smos_db_managed_cassandra_command_async.py | 43 - ...mos_db_managed_cassandra_command_result.py | 43 - ...db_managed_cassandra_data_center_create.py | 2 +- ...db_managed_cassandra_data_center_delete.py | 2 +- ...os_db_managed_cassandra_data_center_get.py | 2 +- ...s_db_managed_cassandra_data_center_list.py | 2 +- ..._db_managed_cassandra_data_center_patch.py | 2 +- ...osmos_db_managed_cassandra_list_command.py | 43 - .../cosmos_db_managed_cassandra_status.py | 4 +- ...terialized_views_builder_service_create.py | 2 +- ...terialized_views_builder_service_delete.py | 2 +- ..._materialized_views_builder_service_get.py | 2 +- ..._mongo_db_collection_backup_information.py | 2 +- .../cosmos_db_mongo_db_collection_delete.py | 2 +- .../cosmos_db_mongo_db_collection_get.py | 2 +- .../cosmos_db_mongo_db_collection_list.py | 2 +- ...ongo_db_collection_migrate_to_autoscale.py | 2 +- ...collection_migrate_to_manual_throughput.py | 2 +- ..._db_mongo_db_collection_partition_merge.py | 45 - ...o_db_collection_redistribute_throughput.py | 56 - ...ection_retrieve_throughput_distribution.py | 47 - ...s_db_mongo_db_collection_throughput_get.py | 2 +- ...b_mongo_db_collection_throughput_update.py | 2 +- .../cosmos_db_mongo_db_database_delete.py | 2 +- .../cosmos_db_mongo_db_database_get.py | 2 +- .../cosmos_db_mongo_db_database_list.py | 2 +- ..._mongo_db_database_migrate_to_autoscale.py | 2 +- ...b_database_migrate_to_manual_throughput.py | 2 +- ...os_db_mongo_db_database_partition_merge.py | 44 - ...ngo_db_database_redistribute_throughput.py | 55 - ...tabase_retrieve_throughput_distribution.py | 46 - ...mos_db_mongo_db_database_throughput_get.py | 2 +- ..._db_mongo_db_database_throughput_update.py | 2 +- ..._mongo_db_role_definition_create_update.py | 2 +- ...smos_db_mongo_db_role_definition_delete.py | 2 +- .../cosmos_db_mongo_db_role_definition_get.py | 2 +- ...cosmos_db_mongo_db_role_definition_list.py | 2 +- ..._mongo_db_user_definition_create_update.py | 2 +- ...smos_db_mongo_db_user_definition_delete.py | 2 +- .../cosmos_db_mongo_db_user_definition_get.py | 2 +- ...cosmos_db_mongo_db_user_definition_list.py | 2 +- .../cosmos_db_notebook_workspace_delete.py | 2 +- .../cosmos_db_notebook_workspace_get.py | 2 +- .../cosmos_db_notebook_workspace_list.py | 2 +- ...notebook_workspace_list_connection_info.py | 2 +- ...otebook_workspace_regenerate_auth_token.py | 2 +- .../cosmos_db_notebook_workspace_start.py | 2 +- .../cosmos_db_operations_list.py | 2 +- .../cosmos_db_percentile_get_metrics.py | 2 +- ...db_percentile_source_target_get_metrics.py | 2 +- ...cosmos_db_percentile_target_get_metrics.py | 2 +- ...s_db_private_endpoint_connection_delete.py | 2 +- ...smos_db_private_endpoint_connection_get.py | 2 +- ...db_private_endpoint_connection_list_get.py | 2 +- ...s_db_private_endpoint_connection_update.py | 2 +- .../cosmos_db_private_link_resource_get.py | 2 +- ...osmos_db_private_link_resource_list_get.py | 2 +- ...cosmos_db_region_collection_get_metrics.py | 2 +- ...smos_db_restorable_database_account_get.py | 2 +- ...mos_db_restorable_database_account_list.py | 2 +- ...rable_database_account_no_location_list.py | 2 +- ...mos_db_restorable_gremlin_database_list.py | 2 +- ...cosmos_db_restorable_gremlin_graph_list.py | 2 +- ...mos_db_restorable_gremlin_resource_list.py | 2 +- ...s_db_restorable_mongodb_collection_list.py | 2 +- ...mos_db_restorable_mongodb_database_list.py | 2 +- ...mos_db_restorable_mongodb_resource_list.py | 2 +- ...cosmos_db_restorable_sql_container_list.py | 2 +- .../cosmos_db_restorable_sql_database_list.py | 2 +- .../cosmos_db_restorable_sql_resource_list.py | 2 +- .../cosmos_db_restorable_table_list.py | 2 +- ...osmos_db_restorable_table_resource_list.py | 2 +- ..._restore_database_account_create_update.py | 4 +- .../cosmos_db_services_list.py | 2 +- ...sql_client_encryption_key_create_update.py | 4 +- ...cosmos_db_sql_client_encryption_key_get.py | 2 +- ...smos_db_sql_client_encryption_keys_list.py | 2 +- ...mos_db_sql_container_backup_information.py | 2 +- .../cosmos_db_sql_container_create_update.py | 10 +- .../cosmos_db_sql_container_delete.py | 2 +- .../cosmos_db_sql_container_get.py | 2 +- .../cosmos_db_sql_container_list.py | 2 +- ...s_db_sql_container_migrate_to_autoscale.py | 2 +- ..._container_migrate_to_manual_throughput.py | 2 +- ...cosmos_db_sql_container_partition_merge.py | 45 - ...b_sql_container_redistribute_throughput.py | 56 - .../cosmos_db_sql_container_restore.py | 60 - ...tainer_retrieve_throughput_distribution.py | 47 - .../cosmos_db_sql_container_throughput_get.py | 2 +- ...smos_db_sql_container_throughput_update.py | 2 +- .../cosmos_db_sql_database_create_update.py | 2 +- .../cosmos_db_sql_database_delete.py | 2 +- .../cosmos_db_sql_database_get.py | 2 +- .../cosmos_db_sql_database_list.py | 2 +- ...os_db_sql_database_migrate_to_autoscale.py | 2 +- ...l_database_migrate_to_manual_throughput.py | 2 +- .../cosmos_db_sql_database_partition_merge.py | 44 - ...db_sql_database_redistribute_throughput.py | 55 - .../cosmos_db_sql_database_restore.py | 59 - ...tabase_retrieve_throughput_distribution.py | 46 - .../cosmos_db_sql_database_throughput_get.py | 2 +- ...osmos_db_sql_database_throughput_update.py | 2 +- ..._db_sql_materialized_view_create_update.py | 73 - ...os_db_sql_role_assignment_create_update.py | 2 +- .../cosmos_db_sql_role_assignment_delete.py | 2 +- .../cosmos_db_sql_role_assignment_get.py | 2 +- .../cosmos_db_sql_role_assignment_list.py | 2 +- ...os_db_sql_role_definition_create_update.py | 2 +- .../cosmos_db_sql_role_definition_delete.py | 2 +- .../cosmos_db_sql_role_definition_get.py | 2 +- .../cosmos_db_sql_role_definition_list.py | 2 +- ...s_db_sql_stored_procedure_create_update.py | 2 +- .../cosmos_db_sql_stored_procedure_delete.py | 2 +- .../cosmos_db_sql_stored_procedure_get.py | 2 +- .../cosmos_db_sql_stored_procedure_list.py | 2 +- .../cosmos_db_sql_trigger_create_update.py | 2 +- .../cosmos_db_sql_trigger_delete.py | 2 +- .../cosmos_db_sql_trigger_get.py | 2 +- .../cosmos_db_sql_trigger_list.py | 2 +- ...sql_user_defined_function_create_update.py | 2 +- ...mos_db_sql_user_defined_function_delete.py | 2 +- ...cosmos_db_sql_user_defined_function_get.py | 2 +- ...osmos_db_sql_user_defined_function_list.py | 2 +- .../cosmos_db_table_backup_information.py | 2 +- .../cosmos_db_table_create_update.py | 2 +- .../cosmos_db_table_delete.py | 2 +- .../generated_samples/cosmos_db_table_get.py | 2 +- .../generated_samples/cosmos_db_table_list.py | 2 +- .../cosmos_db_table_migrate_to_autoscale.py | 2 +- ...s_db_table_migrate_to_manual_throughput.py | 2 +- .../cosmos_db_table_throughput_get.py | 2 +- .../cosmos_db_table_throughput_update.py | 2 +- .../cosmos_dbp_key_range_id_get_metrics.py | 2 +- ...mos_dbp_key_range_id_region_get_metrics.py | 2 +- .../cosmos_db_data_transfer_job_cancel.py | 43 - .../cosmos_db_data_transfer_job_complete.py | 43 - .../cosmos_db_data_transfer_job_create.py | 53 - .../cosmos_db_data_transfer_job_feed.py | 43 - .../cosmos_db_data_transfer_job_get.py | 43 - .../cosmos_db_data_transfer_job_pause.py | 43 - .../cosmos_db_data_transfer_job_resume.py | 43 - ...rk_security_perimeter_configuration_get.py | 43 - ...k_security_perimeter_configuration_list.py | 43 - ...urity_perimeter_configuration_reconcile.py | 42 - ...db_sql_dedicated_gateway_service_create.py | 2 +- ...db_sql_dedicated_gateway_service_delete.py | 2 +- ...os_db_sql_dedicated_gateway_service_get.py | 2 +- ..._db_table_role_assignment_create_update.py | 50 - .../cosmos_db_table_role_assignment_delete.py | 42 - .../cosmos_db_table_role_assignment_get.py | 43 - .../cosmos_db_table_role_assignment_list.py | 43 - ..._db_table_role_definition_create_update.py | 62 - .../cosmos_db_table_role_definition_delete.py | 42 - .../cosmos_db_table_role_definition_get.py | 43 - .../cosmos_db_table_role_definition_list.py | 43 - ...osmos_db_throughput_pool_account_create.py | 49 - ...osmos_db_throughput_pool_account_delete.py | 42 - .../cosmos_db_throughput_pool_account_get.py | 43 - ...cosmos_db_throughput_pool_accounts_list.py | 43 - .../cosmos_db_throughput_pool_create.py | 43 - .../cosmos_db_throughput_pool_delete.py | 41 - .../cosmos_db_throughput_pool_get.py | 42 - .../cosmos_db_throughput_pool_list.py | 42 - .../cosmos_db_throughput_pool_update.py | 42 - ...anagement_cassandra_clusters_operations.py | 95 +- ...ent_cassandra_clusters_operations_async.py | 103 +- ...ement_cassandra_data_centers_operations.py | 10 +- ...cassandra_data_centers_operations_async.py | 10 +- ...nagement_cassandra_resources_operations.py | 210 +- ...nt_cassandra_resources_operations_async.py | 220 +- ...mos_db_management_collection_operations.py | 6 +- ..._management_collection_operations_async.py | 6 +- ...agement_collection_partition_operations.py | 4 +- ...t_collection_partition_operations_async.py | 4 +- ..._collection_partition_region_operations.py | 2 +- ...ction_partition_region_operations_async.py | 2 +- ...management_collection_region_operations.py | 2 +- ...ment_collection_region_operations_async.py | 2 +- ...ment_database_account_region_operations.py | 2 +- ...atabase_account_region_operations_async.py | 2 +- ...management_database_accounts_operations.py | 47 +- ...ment_database_accounts_operations_async.py | 47 +- ...osmos_db_management_database_operations.py | 6 +- ...db_management_database_operations_async.py | 6 +- ...management_gremlin_resources_operations.py | 60 +- ...ment_gremlin_resources_operations_async.py | 60 +- ...smos_db_management_locations_operations.py | 4 +- ...b_management_locations_operations_async.py | 4 +- ...anagement_mongo_db_resources_operations.py | 223 +- ...ent_mongo_db_resources_operations_async.py | 235 +- ...nagement_notebook_workspaces_operations.py | 14 +- ...nt_notebook_workspaces_operations_async.py | 14 +- .../test_cosmos_db_management_operations.py | 2 +- ...t_cosmos_db_management_operations_async.py | 2 +- ...ement_partition_key_range_id_operations.py | 2 +- ...partition_key_range_id_operations_async.py | 2 +- ...artition_key_range_id_region_operations.py | 2 +- ...on_key_range_id_region_operations_async.py | 2 +- ...mos_db_management_percentile_operations.py | 2 +- ..._management_percentile_operations_async.py | 2 +- ...ent_percentile_source_target_operations.py | 2 +- ...rcentile_source_target_operations_async.py | 2 +- ...management_percentile_target_operations.py | 2 +- ...ment_percentile_target_operations_async.py | 2 +- ...private_endpoint_connections_operations.py | 16 +- ...e_endpoint_connections_operations_async.py | 16 +- ...ement_private_link_resources_operations.py | 4 +- ...private_link_resources_operations_async.py | 4 +- ...restorable_database_accounts_operations.py | 6 +- ...able_database_accounts_operations_async.py | 6 +- ...restorable_gremlin_databases_operations.py | 2 +- ...able_gremlin_databases_operations_async.py | 2 +- ...nt_restorable_gremlin_graphs_operations.py | 2 +- ...torable_gremlin_graphs_operations_async.py | 2 +- ...restorable_gremlin_resources_operations.py | 2 +- ...able_gremlin_resources_operations_async.py | 2 +- ...storable_mongodb_collections_operations.py | 2 +- ...le_mongodb_collections_operations_async.py | 2 +- ...restorable_mongodb_databases_operations.py | 2 +- ...able_mongodb_databases_operations_async.py | 2 +- ...restorable_mongodb_resources_operations.py | 2 +- ...able_mongodb_resources_operations_async.py | 2 +- ...nt_restorable_sql_containers_operations.py | 2 +- ...torable_sql_containers_operations_async.py | 2 +- ...ent_restorable_sql_databases_operations.py | 2 +- ...storable_sql_databases_operations_async.py | 2 +- ...ent_restorable_sql_resources_operations.py | 2 +- ...storable_sql_resources_operations_async.py | 2 +- ...t_restorable_table_resources_operations.py | 2 +- ...orable_table_resources_operations_async.py | 2 +- ...management_restorable_tables_operations.py | 2 +- ...ment_restorable_tables_operations_async.py | 2 +- ...cosmos_db_management_service_operations.py | 8 +- ..._db_management_service_operations_async.py | 8 +- ..._db_management_sql_resources_operations.py | 311 +- ...nagement_sql_resources_operations_async.py | 338 +- ...b_management_table_resources_operations.py | 166 +- ...gement_table_resources_operations_async.py | 174 +- .../azure-mgmt-cosmosdb/sdk_packaging.toml | 2 +- sdk/cosmos/azure-mgmt-cosmosdb/setup.py | 2 +- 412 files changed, 10184 insertions(+), 38157 deletions(-) delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_chaos_fault_operations.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_data_transfer_jobs_operations.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_graph_resources_operations.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_network_security_perimeter_configurations_operations.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pool_account_operations.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pool_accounts_operations.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pool_operations.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pools_operations.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_chaos_fault_operations.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_data_transfer_jobs_operations.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_graph_resources_operations.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_network_security_perimeter_configurations_operations.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pool_account_operations.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pool_accounts_operations.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pool_operations.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pools_operations.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/chaos_fault_enable_disable.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/chaos_fault_get.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/chaos_fault_list.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_create_update.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_delete.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_get.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_list.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_migrate_to_autoscale.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_migrate_to_manual_throughput.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_throughput_get.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_throughput_update.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_create_update.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_delete.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_get.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_list.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_backup.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_backups_list.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_command_async.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_command_result.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_list_command.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_partition_merge.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_redistribute_throughput.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_retrieve_throughput_distribution.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_partition_merge.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_redistribute_throughput.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_retrieve_throughput_distribution.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_partition_merge.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_redistribute_throughput.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_restore.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_retrieve_throughput_distribution.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_partition_merge.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_redistribute_throughput.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_restore.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_retrieve_throughput_distribution.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_materialized_view_create_update.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_cancel.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_complete.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_create.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_feed.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_get.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_pause.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_resume.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/network_security_perimeter_configuration_get.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/network_security_perimeter_configuration_list.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/network_security_perimeter_configuration_reconcile.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_assignment_create_update.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_assignment_delete.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_assignment_get.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_assignment_list.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_definition_create_update.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_definition_delete.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_definition_get.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_definition_list.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_account_create.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_account_delete.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_account_get.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_accounts_list.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_create.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_delete.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_get.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_list.py delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_update.py diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/CHANGELOG.md b/sdk/cosmos/azure-mgmt-cosmosdb/CHANGELOG.md index 41f5a326b8a0..cd3bf000bef2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/CHANGELOG.md +++ b/sdk/cosmos/azure-mgmt-cosmosdb/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 9.8.0 (2025-04-15) + +### Features Added + + - Model `RestorableSqlContainerPropertiesResourceContainer` added property `full_text_policy` + - Model `SqlContainerGetPropertiesResource` added property `full_text_policy` + - Model `SqlContainerResource` added property `full_text_policy` + - Added model `FullTextPath` + - Added model `FullTextPolicy` + ## 10.0.0b5 (2024-12-23) ### Features Added diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/README.md b/sdk/cosmos/azure-mgmt-cosmosdb/README.md index d5ea6e879b60..235419d949ba 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/README.md +++ b/sdk/cosmos/azure-mgmt-cosmosdb/README.md @@ -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/cosmos/azure-mgmt-cosmosdb/_meta.json b/sdk/cosmos/azure-mgmt-cosmosdb/_meta.json index 334ec5daeaa6..da3bf86fbbc7 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/_meta.json +++ b/sdk/cosmos/azure-mgmt-cosmosdb/_meta.json @@ -1,11 +1,11 @@ { - "commit": "4aad50a36767f7c36673f2c7982bb4055dbf5ed4", + "commit": "54e2fa051779a091a31d804fce47087da5b23577", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.10.2", "use": [ - "@autorest/python@6.26.4", + "@autorest/python@6.27.4", "@autorest/modelerfour@4.27.0" ], - "autorest_command": "autorest specification/cosmos-db/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.26.4 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", + "autorest_command": "autorest specification/cosmos-db/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.27.4 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", "readme": "specification/cosmos-db/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_configuration.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_configuration.py index 70669f246f16..7b40387ddf8b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_configuration.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_configuration.py @@ -25,15 +25,15 @@ class CosmosDBManagementClientConfiguration: # pylint: disable=too-many-instanc :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2024-12-01-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2025-04-15". 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", "2024-12-01-preview") + api_version: str = kwargs.pop("api_version", "2025-04-15") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_cosmos_db_management_client.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_cosmos_db_management_client.py index 00dac0e6125b..ec893a2d7bc3 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_cosmos_db_management_client.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_cosmos_db_management_client.py @@ -22,20 +22,16 @@ CassandraClustersOperations, CassandraDataCentersOperations, CassandraResourcesOperations, - ChaosFaultOperations, CollectionOperations, CollectionPartitionOperations, CollectionPartitionRegionOperations, CollectionRegionOperations, - DataTransferJobsOperations, DatabaseAccountRegionOperations, DatabaseAccountsOperations, DatabaseOperations, - GraphResourcesOperations, GremlinResourcesOperations, LocationsOperations, MongoDBResourcesOperations, - NetworkSecurityPerimeterConfigurationsOperations, NotebookWorkspacesOperations, Operations, PartitionKeyRangeIdOperations, @@ -60,10 +56,6 @@ ServiceOperations, SqlResourcesOperations, TableResourcesOperations, - ThroughputPoolAccountOperations, - ThroughputPoolAccountsOperations, - ThroughputPoolOperations, - ThroughputPoolsOperations, ) if TYPE_CHECKING: @@ -71,10 +63,8 @@ class CosmosDBManagementClient: # pylint: disable=too-many-instance-attributes - """Azure Cosmos DB Chaos Fault REST API. + """Azure Cosmos DB Database Service Resource Provider REST API. - :ivar chaos_fault: ChaosFaultOperations operations - :vartype chaos_fault: azure.mgmt.cosmosdb.operations.ChaosFaultOperations :ivar database_accounts: DatabaseAccountsOperations operations :vartype database_accounts: azure.mgmt.cosmosdb.operations.DatabaseAccountsOperations :ivar operations: Operations operations @@ -105,8 +95,6 @@ class CosmosDBManagementClient: # pylint: disable=too-many-instance-attributes :ivar partition_key_range_id_region: PartitionKeyRangeIdRegionOperations operations :vartype partition_key_range_id_region: azure.mgmt.cosmosdb.operations.PartitionKeyRangeIdRegionOperations - :ivar graph_resources: GraphResourcesOperations operations - :vartype graph_resources: azure.mgmt.cosmosdb.operations.GraphResourcesOperations :ivar sql_resources: SqlResourcesOperations operations :vartype sql_resources: azure.mgmt.cosmosdb.operations.SqlResourcesOperations :ivar mongo_db_resources: MongoDBResourcesOperations operations @@ -119,16 +107,10 @@ class CosmosDBManagementClient: # pylint: disable=too-many-instance-attributes :vartype gremlin_resources: azure.mgmt.cosmosdb.operations.GremlinResourcesOperations :ivar locations: LocationsOperations operations :vartype locations: azure.mgmt.cosmosdb.operations.LocationsOperations - :ivar data_transfer_jobs: DataTransferJobsOperations operations - :vartype data_transfer_jobs: azure.mgmt.cosmosdb.operations.DataTransferJobsOperations :ivar cassandra_clusters: CassandraClustersOperations operations :vartype cassandra_clusters: azure.mgmt.cosmosdb.operations.CassandraClustersOperations :ivar cassandra_data_centers: CassandraDataCentersOperations operations :vartype cassandra_data_centers: azure.mgmt.cosmosdb.operations.CassandraDataCentersOperations - :ivar network_security_perimeter_configurations: - NetworkSecurityPerimeterConfigurationsOperations operations - :vartype network_security_perimeter_configurations: - azure.mgmt.cosmosdb.operations.NetworkSecurityPerimeterConfigurationsOperations :ivar notebook_workspaces: NotebookWorkspacesOperations operations :vartype notebook_workspaces: azure.mgmt.cosmosdb.operations.NotebookWorkspacesOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations @@ -173,24 +155,14 @@ class CosmosDBManagementClient: # pylint: disable=too-many-instance-attributes azure.mgmt.cosmosdb.operations.RestorableTableResourcesOperations :ivar service: ServiceOperations operations :vartype service: azure.mgmt.cosmosdb.operations.ServiceOperations - :ivar throughput_pools: ThroughputPoolsOperations operations - :vartype throughput_pools: azure.mgmt.cosmosdb.operations.ThroughputPoolsOperations - :ivar throughput_pool: ThroughputPoolOperations operations - :vartype throughput_pool: azure.mgmt.cosmosdb.operations.ThroughputPoolOperations - :ivar throughput_pool_accounts: ThroughputPoolAccountsOperations operations - :vartype throughput_pool_accounts: - azure.mgmt.cosmosdb.operations.ThroughputPoolAccountsOperations - :ivar throughput_pool_account: ThroughputPoolAccountOperations operations - :vartype throughput_pool_account: - azure.mgmt.cosmosdb.operations.ThroughputPoolAccountOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2024-12-01-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2025-04-15". 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. @@ -230,7 +202,6 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.chaos_fault = ChaosFaultOperations(self._client, self._config, self._serialize, self._deserialize) self.database_accounts = DatabaseAccountsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -262,7 +233,6 @@ def __init__( self.partition_key_range_id_region = PartitionKeyRangeIdRegionOperations( self._client, self._config, self._serialize, self._deserialize ) - self.graph_resources = GraphResourcesOperations(self._client, self._config, self._serialize, self._deserialize) self.sql_resources = SqlResourcesOperations(self._client, self._config, self._serialize, self._deserialize) self.mongo_db_resources = MongoDBResourcesOperations( self._client, self._config, self._serialize, self._deserialize @@ -275,18 +245,12 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.locations = LocationsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_transfer_jobs = DataTransferJobsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.cassandra_clusters = CassandraClustersOperations( self._client, self._config, self._serialize, self._deserialize ) self.cassandra_data_centers = CassandraDataCentersOperations( self._client, self._config, self._serialize, self._deserialize ) - self.network_security_perimeter_configurations = NetworkSecurityPerimeterConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.notebook_workspaces = NotebookWorkspacesOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -333,16 +297,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.service = ServiceOperations(self._client, self._config, self._serialize, self._deserialize) - self.throughput_pools = ThroughputPoolsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.throughput_pool = ThroughputPoolOperations(self._client, self._config, self._serialize, self._deserialize) - self.throughput_pool_accounts = ThroughputPoolAccountsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.throughput_pool_account = ThroughputPoolAccountOperations( - self._client, self._config, self._serialize, self._deserialize - ) def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_serialization.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_serialization.py index ce17d1798ce7..b24ab2885450 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_serialization.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_serialization.py @@ -310,7 +310,7 @@ def _create_xml_node(tag, prefix=None, ns=None): return ET.Element(tag) -class Model(object): +class Model: """Mixin for all client request body/response body models to support serialization and deserialization. """ @@ -563,7 +563,7 @@ def _decode_attribute_map_key(key): return key.replace("\\.", ".") -class Serializer(object): # pylint: disable=too-many-public-methods +class Serializer: # pylint: disable=too-many-public-methods """Request object model serializer.""" basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -1441,7 +1441,7 @@ def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument return children[0] -class Deserializer(object): +class Deserializer: """Response object model deserializer. :param dict classes: Class type dictionary for deserializing complex types. @@ -1683,17 +1683,21 @@ def _instantiate_model(self, response, attrs, additional_properties=None): subtype = getattr(response, "_subtype_map", {}) try: readonly = [ - k for k, v in response._validation.items() if v.get("readonly") # pylint: disable=protected-access + 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() if v.get("constant") # pylint: disable=protected-access + 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 diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_version.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_version.py index 369c45b5ae2e..0af10a91d063 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_version.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "10.0.0b5" +VERSION = "9.8.0" diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/_configuration.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/_configuration.py index 8dc5dcb05ae1..446edb5fef39 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/_configuration.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/_configuration.py @@ -25,15 +25,15 @@ class CosmosDBManagementClientConfiguration: # pylint: disable=too-many-instanc :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2024-12-01-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2025-04-15". 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", "2024-12-01-preview") + api_version: str = kwargs.pop("api_version", "2025-04-15") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/_cosmos_db_management_client.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/_cosmos_db_management_client.py index 87aab6650797..7f93e867ca10 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/_cosmos_db_management_client.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/_cosmos_db_management_client.py @@ -22,20 +22,16 @@ CassandraClustersOperations, CassandraDataCentersOperations, CassandraResourcesOperations, - ChaosFaultOperations, CollectionOperations, CollectionPartitionOperations, CollectionPartitionRegionOperations, CollectionRegionOperations, - DataTransferJobsOperations, DatabaseAccountRegionOperations, DatabaseAccountsOperations, DatabaseOperations, - GraphResourcesOperations, GremlinResourcesOperations, LocationsOperations, MongoDBResourcesOperations, - NetworkSecurityPerimeterConfigurationsOperations, NotebookWorkspacesOperations, Operations, PartitionKeyRangeIdOperations, @@ -60,10 +56,6 @@ ServiceOperations, SqlResourcesOperations, TableResourcesOperations, - ThroughputPoolAccountOperations, - ThroughputPoolAccountsOperations, - ThroughputPoolOperations, - ThroughputPoolsOperations, ) if TYPE_CHECKING: @@ -71,10 +63,8 @@ class CosmosDBManagementClient: # pylint: disable=too-many-instance-attributes - """Azure Cosmos DB Chaos Fault REST API. + """Azure Cosmos DB Database Service Resource Provider REST API. - :ivar chaos_fault: ChaosFaultOperations operations - :vartype chaos_fault: azure.mgmt.cosmosdb.aio.operations.ChaosFaultOperations :ivar database_accounts: DatabaseAccountsOperations operations :vartype database_accounts: azure.mgmt.cosmosdb.aio.operations.DatabaseAccountsOperations :ivar operations: Operations operations @@ -106,8 +96,6 @@ class CosmosDBManagementClient: # pylint: disable=too-many-instance-attributes :ivar partition_key_range_id_region: PartitionKeyRangeIdRegionOperations operations :vartype partition_key_range_id_region: azure.mgmt.cosmosdb.aio.operations.PartitionKeyRangeIdRegionOperations - :ivar graph_resources: GraphResourcesOperations operations - :vartype graph_resources: azure.mgmt.cosmosdb.aio.operations.GraphResourcesOperations :ivar sql_resources: SqlResourcesOperations operations :vartype sql_resources: azure.mgmt.cosmosdb.aio.operations.SqlResourcesOperations :ivar mongo_db_resources: MongoDBResourcesOperations operations @@ -120,17 +108,11 @@ class CosmosDBManagementClient: # pylint: disable=too-many-instance-attributes :vartype gremlin_resources: azure.mgmt.cosmosdb.aio.operations.GremlinResourcesOperations :ivar locations: LocationsOperations operations :vartype locations: azure.mgmt.cosmosdb.aio.operations.LocationsOperations - :ivar data_transfer_jobs: DataTransferJobsOperations operations - :vartype data_transfer_jobs: azure.mgmt.cosmosdb.aio.operations.DataTransferJobsOperations :ivar cassandra_clusters: CassandraClustersOperations operations :vartype cassandra_clusters: azure.mgmt.cosmosdb.aio.operations.CassandraClustersOperations :ivar cassandra_data_centers: CassandraDataCentersOperations operations :vartype cassandra_data_centers: azure.mgmt.cosmosdb.aio.operations.CassandraDataCentersOperations - :ivar network_security_perimeter_configurations: - NetworkSecurityPerimeterConfigurationsOperations operations - :vartype network_security_perimeter_configurations: - azure.mgmt.cosmosdb.aio.operations.NetworkSecurityPerimeterConfigurationsOperations :ivar notebook_workspaces: NotebookWorkspacesOperations operations :vartype notebook_workspaces: azure.mgmt.cosmosdb.aio.operations.NotebookWorkspacesOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations @@ -176,24 +158,14 @@ class CosmosDBManagementClient: # pylint: disable=too-many-instance-attributes azure.mgmt.cosmosdb.aio.operations.RestorableTableResourcesOperations :ivar service: ServiceOperations operations :vartype service: azure.mgmt.cosmosdb.aio.operations.ServiceOperations - :ivar throughput_pools: ThroughputPoolsOperations operations - :vartype throughput_pools: azure.mgmt.cosmosdb.aio.operations.ThroughputPoolsOperations - :ivar throughput_pool: ThroughputPoolOperations operations - :vartype throughput_pool: azure.mgmt.cosmosdb.aio.operations.ThroughputPoolOperations - :ivar throughput_pool_accounts: ThroughputPoolAccountsOperations operations - :vartype throughput_pool_accounts: - azure.mgmt.cosmosdb.aio.operations.ThroughputPoolAccountsOperations - :ivar throughput_pool_account: ThroughputPoolAccountOperations operations - :vartype throughput_pool_account: - azure.mgmt.cosmosdb.aio.operations.ThroughputPoolAccountOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2024-12-01-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2025-04-15". 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. @@ -233,7 +205,6 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.chaos_fault = ChaosFaultOperations(self._client, self._config, self._serialize, self._deserialize) self.database_accounts = DatabaseAccountsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -265,7 +236,6 @@ def __init__( self.partition_key_range_id_region = PartitionKeyRangeIdRegionOperations( self._client, self._config, self._serialize, self._deserialize ) - self.graph_resources = GraphResourcesOperations(self._client, self._config, self._serialize, self._deserialize) self.sql_resources = SqlResourcesOperations(self._client, self._config, self._serialize, self._deserialize) self.mongo_db_resources = MongoDBResourcesOperations( self._client, self._config, self._serialize, self._deserialize @@ -278,18 +248,12 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.locations = LocationsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_transfer_jobs = DataTransferJobsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.cassandra_clusters = CassandraClustersOperations( self._client, self._config, self._serialize, self._deserialize ) self.cassandra_data_centers = CassandraDataCentersOperations( self._client, self._config, self._serialize, self._deserialize ) - self.network_security_perimeter_configurations = NetworkSecurityPerimeterConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.notebook_workspaces = NotebookWorkspacesOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -336,16 +300,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.service = ServiceOperations(self._client, self._config, self._serialize, self._deserialize) - self.throughput_pools = ThroughputPoolsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.throughput_pool = ThroughputPoolOperations(self._client, self._config, self._serialize, self._deserialize) - self.throughput_pool_accounts = ThroughputPoolAccountsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.throughput_pool_account = ThroughputPoolAccountOperations( - self._client, self._config, self._serialize, self._deserialize - ) def _send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/__init__.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/__init__.py index 2654ee4c1eb6..d47da53e4f4d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/__init__.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/__init__.py @@ -12,7 +12,6 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._chaos_fault_operations import ChaosFaultOperations # type: ignore from ._database_accounts_operations import DatabaseAccountsOperations # type: ignore from ._operations import Operations # type: ignore from ._database_operations import DatabaseOperations # type: ignore @@ -26,17 +25,14 @@ from ._collection_partition_operations import CollectionPartitionOperations # type: ignore from ._partition_key_range_id_operations import PartitionKeyRangeIdOperations # type: ignore from ._partition_key_range_id_region_operations import PartitionKeyRangeIdRegionOperations # type: ignore -from ._graph_resources_operations import GraphResourcesOperations # type: ignore from ._sql_resources_operations import SqlResourcesOperations # type: ignore from ._mongo_db_resources_operations import MongoDBResourcesOperations # type: ignore from ._table_resources_operations import TableResourcesOperations # type: ignore from ._cassandra_resources_operations import CassandraResourcesOperations # type: ignore from ._gremlin_resources_operations import GremlinResourcesOperations # type: ignore from ._locations_operations import LocationsOperations # type: ignore -from ._data_transfer_jobs_operations import DataTransferJobsOperations # type: ignore from ._cassandra_clusters_operations import CassandraClustersOperations # type: ignore from ._cassandra_data_centers_operations import CassandraDataCentersOperations # type: ignore -from ._network_security_perimeter_configurations_operations import NetworkSecurityPerimeterConfigurationsOperations # type: ignore from ._notebook_workspaces_operations import NotebookWorkspacesOperations # type: ignore from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations # type: ignore from ._private_link_resources_operations import PrivateLinkResourcesOperations # type: ignore @@ -53,17 +49,12 @@ from ._restorable_tables_operations import RestorableTablesOperations # type: ignore from ._restorable_table_resources_operations import RestorableTableResourcesOperations # type: ignore from ._service_operations import ServiceOperations # type: ignore -from ._throughput_pools_operations import ThroughputPoolsOperations # type: ignore -from ._throughput_pool_operations import ThroughputPoolOperations # type: ignore -from ._throughput_pool_accounts_operations import ThroughputPoolAccountsOperations # type: ignore -from ._throughput_pool_account_operations import ThroughputPoolAccountOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ - "ChaosFaultOperations", "DatabaseAccountsOperations", "Operations", "DatabaseOperations", @@ -77,17 +68,14 @@ "CollectionPartitionOperations", "PartitionKeyRangeIdOperations", "PartitionKeyRangeIdRegionOperations", - "GraphResourcesOperations", "SqlResourcesOperations", "MongoDBResourcesOperations", "TableResourcesOperations", "CassandraResourcesOperations", "GremlinResourcesOperations", "LocationsOperations", - "DataTransferJobsOperations", "CassandraClustersOperations", "CassandraDataCentersOperations", - "NetworkSecurityPerimeterConfigurationsOperations", "NotebookWorkspacesOperations", "PrivateEndpointConnectionsOperations", "PrivateLinkResourcesOperations", @@ -104,10 +92,6 @@ "RestorableTablesOperations", "RestorableTableResourcesOperations", "ServiceOperations", - "ThroughputPoolsOperations", - "ThroughputPoolOperations", - "ThroughputPoolAccountsOperations", - "ThroughputPoolAccountOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_clusters_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_clusters_operations.py index 21099125d46c..b01d7d212eea 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_clusters_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_clusters_operations.py @@ -36,15 +36,10 @@ build_create_update_request, build_deallocate_request, build_delete_request, - build_get_backup_request, - build_get_command_async_request, build_get_request, - build_invoke_command_async_request, build_invoke_command_request, - build_list_backups_request, build_list_by_resource_group_request, build_list_by_subscription_request, - build_list_command_request, build_start_request, build_status_request, build_update_request, @@ -58,7 +53,7 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class CassandraClustersOperations: # pylint: disable=too-many-public-methods +class CassandraClustersOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -968,496 +963,8 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _invoke_command_async_initial( - self, - resource_group_name: str, - cluster_name: str, - body: Union[_models.CommandAsyncPostBody, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "CommandAsyncPostBody") - - _request = build_invoke_command_async_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - 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["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_invoke_command_async( - self, - resource_group_name: str, - cluster_name: str, - body: _models.CommandAsyncPostBody, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommandPublicResource]: - """Invoke a command like nodetool for cassandra maintenance asynchronously. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :param body: Specification which command to run where. Required. - :type body: ~azure.mgmt.cosmosdb.models.CommandAsyncPostBody - :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 CommandPublicResource or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.CommandPublicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_invoke_command_async( - self, - resource_group_name: str, - cluster_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommandPublicResource]: - """Invoke a command like nodetool for cassandra maintenance asynchronously. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :param body: Specification which command to run where. 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 CommandPublicResource or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.CommandPublicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_invoke_command_async( - self, - resource_group_name: str, - cluster_name: str, - body: Union[_models.CommandAsyncPostBody, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.CommandPublicResource]: - """Invoke a command like nodetool for cassandra maintenance asynchronously. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :param body: Specification which command to run where. Is either a CommandAsyncPostBody type or - a IO[bytes] type. Required. - :type body: ~azure.mgmt.cosmosdb.models.CommandAsyncPostBody or IO[bytes] - :return: An instance of AsyncLROPoller that returns either CommandPublicResource or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.CommandPublicResource] - :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.CommandPublicResource] = 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._invoke_command_async_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommandPublicResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.CommandPublicResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.CommandPublicResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def list_command( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncIterable["_models.CommandPublicResource"]: - """List all commands currently running on ring info. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :return: An iterator like instance of either CommandPublicResource or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.CommandPublicResource] - :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.ListCommands] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_command_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ListCommands", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get_command_async( - self, resource_group_name: str, cluster_name: str, command_id: str, **kwargs: Any - ) -> _models.CommandPublicResource: - """Get details about a specified command that was run asynchronously. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :param command_id: Managed Cassandra cluster command id. Required. - :type command_id: str - :return: CommandPublicResource or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.CommandPublicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommandPublicResource] = kwargs.pop("cls", None) - - _request = build_get_command_async_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - command_id=command_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CommandPublicResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_backups( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncIterable["_models.BackupResource"]: - """List the backups of this cluster that are available to restore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :return: An iterator like instance of either BackupResource or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.BackupResource] - :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.ListBackups] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_backups_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ListBackups", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get_backup( - self, resource_group_name: str, cluster_name: str, backup_id: str, **kwargs: Any - ) -> _models.BackupResource: - """Get the properties of an individual backup of this cluster that is available to restore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :param backup_id: Id of a restorable backup of a Cassandra cluster. Required. - :type backup_id: str - :return: BackupResource or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.BackupResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BackupResource] = kwargs.pop("cls", None) - - _request = build_get_backup_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - backup_id=backup_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("BackupResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - async def _deallocate_initial( - self, resource_group_name: str, cluster_name: str, x_ms_force_deallocate: Optional[str] = None, **kwargs: Any + self, resource_group_name: str, cluster_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1477,7 +984,6 @@ async def _deallocate_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, - x_ms_force_deallocate=x_ms_force_deallocate, api_version=api_version, headers=_headers, params=_params, @@ -1509,7 +1015,7 @@ async def _deallocate_initial( @distributed_trace_async async def begin_deallocate( - self, resource_group_name: str, cluster_name: str, x_ms_force_deallocate: Optional[str] = None, **kwargs: Any + self, resource_group_name: str, cluster_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host virtual machine of this cluster, and reserved the data disk. This won't do @@ -1520,10 +1026,6 @@ async def begin_deallocate( :type resource_group_name: str :param cluster_name: Managed Cassandra cluster name. Required. :type cluster_name: str - :param x_ms_force_deallocate: Force to deallocate a cluster of Cluster Type Production. Force - to deallocate a cluster of Cluster Type Production might cause data loss. Default value is - None. - :type x_ms_force_deallocate: 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: @@ -1540,7 +1042,6 @@ async def begin_deallocate( raw_result = await self._deallocate_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, - x_ms_force_deallocate=x_ms_force_deallocate, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_resources_operations.py index 4d8e45f7abc4..f06e084edb5b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_resources_operations.py @@ -35,28 +35,20 @@ from ...operations._cassandra_resources_operations import ( build_create_update_cassandra_keyspace_request, build_create_update_cassandra_table_request, - build_create_update_cassandra_view_request, build_delete_cassandra_keyspace_request, build_delete_cassandra_table_request, - build_delete_cassandra_view_request, build_get_cassandra_keyspace_request, build_get_cassandra_keyspace_throughput_request, build_get_cassandra_table_request, build_get_cassandra_table_throughput_request, - build_get_cassandra_view_request, - build_get_cassandra_view_throughput_request, build_list_cassandra_keyspaces_request, build_list_cassandra_tables_request, - build_list_cassandra_views_request, build_migrate_cassandra_keyspace_to_autoscale_request, build_migrate_cassandra_keyspace_to_manual_throughput_request, build_migrate_cassandra_table_to_autoscale_request, build_migrate_cassandra_table_to_manual_throughput_request, - build_migrate_cassandra_view_to_autoscale_request, - build_migrate_cassandra_view_to_manual_throughput_request, build_update_cassandra_keyspace_throughput_request, build_update_cassandra_table_throughput_request, - build_update_cassandra_view_throughput_request, ) if sys.version_info >= (3, 9): @@ -2143,1049 +2135,3 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller[_models.ThroughputSettingsGetResults]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - - @distributed_trace - def list_cassandra_views( - self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any - ) -> AsyncIterable["_models.CassandraViewGetResults"]: - """Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :return: An iterator like instance of either CassandraViewGetResults or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.CassandraViewGetResults] - :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.CassandraViewListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_cassandra_views_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CassandraViewListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get_cassandra_view( - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any - ) -> _models.CassandraViewGetResults: - """Gets the Cassandra view under an existing Azure Cosmos DB database account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :return: CassandraViewGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.CassandraViewGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CassandraViewGetResults] = kwargs.pop("cls", None) - - _request = build_get_cassandra_view_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CassandraViewGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_update_cassandra_view_initial( - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - view_name: str, - create_update_cassandra_view_parameters: Union[_models.CassandraViewCreateUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(create_update_cassandra_view_parameters, (IOBase, bytes)): - _content = create_update_cassandra_view_parameters - else: - _json = self._serialize.body(create_update_cassandra_view_parameters, "CassandraViewCreateUpdateParameters") - - _request = build_create_update_cassandra_view_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_update_cassandra_view( - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - view_name: str, - create_update_cassandra_view_parameters: _models.CassandraViewCreateUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CassandraViewGetResults]: - """Create or update an Azure Cosmos DB Cassandra View. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :param create_update_cassandra_view_parameters: The parameters to provide for the current - Cassandra View. Required. - :type create_update_cassandra_view_parameters: - ~azure.mgmt.cosmosdb.models.CassandraViewCreateUpdateParameters - :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 CassandraViewGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.CassandraViewGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_update_cassandra_view( - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - view_name: str, - create_update_cassandra_view_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CassandraViewGetResults]: - """Create or update an Azure Cosmos DB Cassandra View. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :param create_update_cassandra_view_parameters: The parameters to provide for the current - Cassandra View. Required. - :type create_update_cassandra_view_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either CassandraViewGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.CassandraViewGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_update_cassandra_view( - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - view_name: str, - create_update_cassandra_view_parameters: Union[_models.CassandraViewCreateUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.CassandraViewGetResults]: - """Create or update an Azure Cosmos DB Cassandra View. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :param create_update_cassandra_view_parameters: The parameters to provide for the current - Cassandra View. Is either a CassandraViewCreateUpdateParameters type or a IO[bytes] type. - Required. - :type create_update_cassandra_view_parameters: - ~azure.mgmt.cosmosdb.models.CassandraViewCreateUpdateParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either CassandraViewGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.CassandraViewGetResults] - :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.CassandraViewGetResults] = 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_update_cassandra_view_initial( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - create_update_cassandra_view_parameters=create_update_cassandra_view_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CassandraViewGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.CassandraViewGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.CassandraViewGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_cassandra_view_initial( - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_cassandra_view_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete_cassandra_view( - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an existing Azure Cosmos DB Cassandra view. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._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_cassandra_view_initial( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace_async - async def get_cassandra_view_throughput( - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any - ) -> _models.ThroughputSettingsGetResults: - """Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database - account with the provided name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :return: ThroughputSettingsGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) - - _request = build_get_cassandra_view_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _update_cassandra_view_throughput_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - view_name: str, - update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(update_throughput_parameters, (IOBase, bytes)): - _content = update_throughput_parameters - else: - _json = self._serialize.body(update_throughput_parameters, "ThroughputSettingsUpdateParameters") - - _request = build_update_cassandra_view_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update_cassandra_view_throughput( - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - view_name: str, - update_throughput_parameters: _models.ThroughputSettingsUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB Cassandra view. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :param update_throughput_parameters: The RUs per second of the parameters to provide for the - current Cassandra view. Required. - :type update_throughput_parameters: - ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters - :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 ThroughputSettingsGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_cassandra_view_throughput( - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - view_name: str, - update_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB Cassandra view. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :param update_throughput_parameters: The RUs per second of the parameters to provide for the - current Cassandra view. Required. - :type update_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_cassandra_view_throughput( - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - view_name: str, - update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB Cassandra view. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :param update_throughput_parameters: The RUs per second of the parameters to provide for the - current Cassandra view. Is either a ThroughputSettingsUpdateParameters type or a IO[bytes] - type. Required. - :type update_throughput_parameters: - ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :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.ThroughputSettingsGetResults] = 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_cassandra_view_throughput_initial( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - update_throughput_parameters=update_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ThroughputSettingsGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _migrate_cassandra_view_to_autoscale_initial( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_migrate_cassandra_view_to_autoscale_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_migrate_cassandra_view_to_autoscale( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: - """Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :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.ThroughputSettingsGetResults] = 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._migrate_cassandra_view_to_autoscale_initial( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ThroughputSettingsGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _migrate_cassandra_view_to_manual_throughput_initial( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_migrate_cassandra_view_to_manual_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_migrate_cassandra_view_to_manual_throughput( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: - """Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :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.ThroughputSettingsGetResults] = 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._migrate_cassandra_view_to_manual_throughput_initial( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ThroughputSettingsGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_chaos_fault_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_chaos_fault_operations.py deleted file mode 100644 index e881ab58ea8b..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_chaos_fault_operations.py +++ /dev/null @@ -1,413 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._chaos_fault_operations import build_enable_disable_request, build_get_request, build_list_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ChaosFaultOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.aio.CosmosDBManagementClient`'s - :attr:`chaos_fault` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> AsyncIterable["_models.ChaosFaultResource"]: - """List Chaos Faults for CosmosDB account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :return: An iterator like instance of either ChaosFaultResource or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.ChaosFaultResource] - :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.ChaosFaultListResponse] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ChaosFaultListResponse", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _enable_disable_initial( - self, - resource_group_name: str, - account_name: str, - chaos_fault: str, - chaos_fault_request: Union[_models.ChaosFaultResource, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(chaos_fault_request, (IOBase, bytes)): - _content = chaos_fault_request - else: - _json = self._serialize.body(chaos_fault_request, "ChaosFaultResource") - - _request = build_enable_disable_request( - resource_group_name=resource_group_name, - account_name=account_name, - chaos_fault=chaos_fault, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_enable_disable( - self, - resource_group_name: str, - account_name: str, - chaos_fault: str, - chaos_fault_request: _models.ChaosFaultResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ChaosFaultResource]: - """Enable, disable Chaos Fault in a CosmosDB account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param chaos_fault: The name of the ChaosFault. Required. - :type chaos_fault: str - :param chaos_fault_request: A request object to enable/disable the chaos fault. Required. - :type chaos_fault_request: ~azure.mgmt.cosmosdb.models.ChaosFaultResource - :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 ChaosFaultResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ChaosFaultResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_enable_disable( - self, - resource_group_name: str, - account_name: str, - chaos_fault: str, - chaos_fault_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ChaosFaultResource]: - """Enable, disable Chaos Fault in a CosmosDB account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param chaos_fault: The name of the ChaosFault. Required. - :type chaos_fault: str - :param chaos_fault_request: A request object to enable/disable the chaos fault. Required. - :type chaos_fault_request: 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 ChaosFaultResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ChaosFaultResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_enable_disable( - self, - resource_group_name: str, - account_name: str, - chaos_fault: str, - chaos_fault_request: Union[_models.ChaosFaultResource, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ChaosFaultResource]: - """Enable, disable Chaos Fault in a CosmosDB account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param chaos_fault: The name of the ChaosFault. Required. - :type chaos_fault: str - :param chaos_fault_request: A request object to enable/disable the chaos fault. Is either a - ChaosFaultResource type or a IO[bytes] type. Required. - :type chaos_fault_request: ~azure.mgmt.cosmosdb.models.ChaosFaultResource or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ChaosFaultResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ChaosFaultResource] - :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.ChaosFaultResource] = 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._enable_disable_initial( - resource_group_name=resource_group_name, - account_name=account_name, - chaos_fault=chaos_fault, - chaos_fault_request=chaos_fault_request, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ChaosFaultResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, 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.ChaosFaultResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ChaosFaultResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace_async - async def get( - self, resource_group_name: str, account_name: str, chaos_fault: str, **kwargs: Any - ) -> _models.ChaosFaultResource: - """Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param chaos_fault: The name of the ChaosFault. Required. - :type chaos_fault: str - :return: ChaosFaultResource or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.ChaosFaultResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ChaosFaultResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - chaos_fault=chaos_fault, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ChaosFaultResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_data_transfer_jobs_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_data_transfer_jobs_operations.py deleted file mode 100644 index 3e983c29cdcf..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_data_transfer_jobs_operations.py +++ /dev/null @@ -1,589 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._data_transfer_jobs_operations import ( - build_cancel_request, - build_complete_request, - build_create_request, - build_get_request, - build_list_by_database_account_request, - build_pause_request, - build_resume_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DataTransferJobsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.aio.CosmosDBManagementClient`'s - :attr:`data_transfer_jobs` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - async def create( - self, - resource_group_name: str, - account_name: str, - job_name: str, - job_create_parameters: _models.CreateJobRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Creates a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :param job_create_parameters: Required. - :type job_create_parameters: ~azure.mgmt.cosmosdb.models.CreateJobRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create( - self, - resource_group_name: str, - account_name: str, - job_name: str, - job_create_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Creates a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :param job_create_parameters: Required. - :type job_create_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create( - self, - resource_group_name: str, - account_name: str, - job_name: str, - job_create_parameters: Union[_models.CreateJobRequest, IO[bytes]], - **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Creates a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :param job_create_parameters: Is either a CreateJobRequest type or a IO[bytes] type. Required. - :type job_create_parameters: ~azure.mgmt.cosmosdb.models.CreateJobRequest or IO[bytes] - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_create_parameters, (IOBase, bytes)): - _content = job_create_parameters - else: - _json = self._serialize.body(job_create_parameters, "CreateJobRequest") - - _request = build_create_request( - resource_group_name=resource_group_name, - account_name=account_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataTransferJobGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get( - self, resource_group_name: str, account_name: str, job_name: str, **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Get a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataTransferJobGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def pause( - self, resource_group_name: str, account_name: str, job_name: str, **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Pause a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) - - _request = build_pause_request( - resource_group_name=resource_group_name, - account_name=account_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataTransferJobGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def resume( - self, resource_group_name: str, account_name: str, job_name: str, **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Resumes a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) - - _request = build_resume_request( - resource_group_name=resource_group_name, - account_name=account_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataTransferJobGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def cancel( - self, resource_group_name: str, account_name: str, job_name: str, **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Cancels a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) - - _request = build_cancel_request( - resource_group_name=resource_group_name, - account_name=account_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataTransferJobGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def complete( - self, resource_group_name: str, account_name: str, job_name: str, **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Completes a Data Transfer Online Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) - - _request = build_complete_request( - resource_group_name=resource_group_name, - account_name=account_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataTransferJobGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_by_database_account( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> AsyncIterable["_models.DataTransferJobGetResults"]: - """Get a list of Data Transfer jobs. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :return: An iterator like instance of either DataTransferJobGetResults or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.DataTransferJobGetResults] - :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.DataTransferJobFeedResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_account_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataTransferJobFeedResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_accounts_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_accounts_operations.py index 958298855f21..920103270ea4 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_accounts_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_accounts_operations.py @@ -1173,7 +1173,7 @@ async def _offline_region_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1369,7 +1369,7 @@ async def _online_region_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_graph_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_graph_resources_operations.py deleted file mode 100644 index 13424097d980..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_graph_resources_operations.py +++ /dev/null @@ -1,543 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._graph_resources_operations import ( - build_create_update_graph_request, - build_delete_graph_resource_request, - build_get_graph_request, - build_list_graphs_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class GraphResourcesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.aio.CosmosDBManagementClient`'s - :attr:`graph_resources` 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_graphs( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> AsyncIterable["_models.GraphResourceGetResults"]: - """Lists the graphs under an existing Azure Cosmos DB database account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :return: An iterator like instance of either GraphResourceGetResults or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.GraphResourceGetResults] - :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.GraphResourcesListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_graphs_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("GraphResourcesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get_graph( - self, resource_group_name: str, account_name: str, graph_name: str, **kwargs: Any - ) -> _models.GraphResourceGetResults: - """Gets the Graph resource under an existing Azure Cosmos DB database account with the provided - name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param graph_name: Cosmos DB graph resource name. Required. - :type graph_name: str - :return: GraphResourceGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.GraphResourceGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.GraphResourceGetResults] = kwargs.pop("cls", None) - - _request = build_get_graph_request( - resource_group_name=resource_group_name, - account_name=account_name, - graph_name=graph_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("GraphResourceGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_update_graph_initial( - self, - resource_group_name: str, - account_name: str, - graph_name: str, - create_update_graph_parameters: Union[_models.GraphResourceCreateUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(create_update_graph_parameters, (IOBase, bytes)): - _content = create_update_graph_parameters - else: - _json = self._serialize.body(create_update_graph_parameters, "GraphResourceCreateUpdateParameters") - - _request = build_create_update_graph_request( - resource_group_name=resource_group_name, - account_name=account_name, - graph_name=graph_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_update_graph( - self, - resource_group_name: str, - account_name: str, - graph_name: str, - create_update_graph_parameters: _models.GraphResourceCreateUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.GraphResourceGetResults]: - """Create or update an Azure Cosmos DB Graph. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param graph_name: Cosmos DB graph resource name. Required. - :type graph_name: str - :param create_update_graph_parameters: The parameters to provide for the current graph. - Required. - :type create_update_graph_parameters: - ~azure.mgmt.cosmosdb.models.GraphResourceCreateUpdateParameters - :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 GraphResourceGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.GraphResourceGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_update_graph( - self, - resource_group_name: str, - account_name: str, - graph_name: str, - create_update_graph_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.GraphResourceGetResults]: - """Create or update an Azure Cosmos DB Graph. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param graph_name: Cosmos DB graph resource name. Required. - :type graph_name: str - :param create_update_graph_parameters: The parameters to provide for the current graph. - Required. - :type create_update_graph_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either GraphResourceGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.GraphResourceGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_update_graph( - self, - resource_group_name: str, - account_name: str, - graph_name: str, - create_update_graph_parameters: Union[_models.GraphResourceCreateUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.GraphResourceGetResults]: - """Create or update an Azure Cosmos DB Graph. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param graph_name: Cosmos DB graph resource name. Required. - :type graph_name: str - :param create_update_graph_parameters: The parameters to provide for the current graph. Is - either a GraphResourceCreateUpdateParameters type or a IO[bytes] type. Required. - :type create_update_graph_parameters: - ~azure.mgmt.cosmosdb.models.GraphResourceCreateUpdateParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either GraphResourceGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.GraphResourceGetResults] - :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.GraphResourceGetResults] = 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_update_graph_initial( - resource_group_name=resource_group_name, - account_name=account_name, - graph_name=graph_name, - create_update_graph_parameters=create_update_graph_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GraphResourceGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.GraphResourceGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.GraphResourceGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_graph_resource_initial( - self, resource_group_name: str, account_name: str, graph_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_graph_resource_request( - resource_group_name=resource_group_name, - account_name=account_name, - graph_name=graph_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete_graph_resource( - self, resource_group_name: str, account_name: str, graph_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an existing Azure Cosmos DB Graph Resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param graph_name: Cosmos DB graph resource name. Required. - :type graph_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._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_graph_resource_initial( - resource_group_name=resource_group_name, - account_name=account_name, - graph_name=graph_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_mongo_db_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_mongo_db_resources_operations.py index 2cfe3f822db6..9373aacfbbdf 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_mongo_db_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_mongo_db_resources_operations.py @@ -47,7 +47,6 @@ build_get_mongo_db_database_throughput_request, build_get_mongo_role_definition_request, build_get_mongo_user_definition_request, - build_list_mongo_db_collection_partition_merge_request, build_list_mongo_db_collections_request, build_list_mongo_db_databases_request, build_list_mongo_role_definitions_request, @@ -56,11 +55,6 @@ build_migrate_mongo_db_collection_to_manual_throughput_request, build_migrate_mongo_db_database_to_autoscale_request, build_migrate_mongo_db_database_to_manual_throughput_request, - build_mongo_db_container_redistribute_throughput_request, - build_mongo_db_container_retrieve_throughput_distribution_request, - build_mongo_db_database_partition_merge_request, - build_mongo_db_database_redistribute_throughput_request, - build_mongo_db_database_retrieve_throughput_distribution_request, build_retrieve_continuous_backup_information_request, build_update_mongo_db_collection_throughput_request, build_update_mongo_db_database_throughput_request, @@ -1100,157 +1094,11 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _mongo_db_database_retrieve_throughput_distribution_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(retrieve_throughput_parameters, (IOBase, bytes)): - _content = retrieve_throughput_parameters - else: - _json = self._serialize.body(retrieve_throughput_parameters, "RetrieveThroughputParameters") - - _request = build_mongo_db_database_retrieve_throughput_distribution_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_mongo_db_database_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: _models.RetrieveThroughputParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current MongoDB database. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - :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 - PhysicalPartitionThroughputInfoResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_mongo_db_database_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current MongoDB database. Required. - :type retrieve_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionThroughputInfoResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_mongo_db_database_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. + @distributed_trace + def list_mongo_db_collections( + self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any + ) -> AsyncIterable["_models.MongoDBCollectionGetResults"]: + """Lists the MongoDB collection under an existing Azure Cosmos DB database account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1259,75 +1107,18 @@ async def begin_mongo_db_database_retrieve_throughput_distribution( # pylint: d :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current MongoDB database. Is either a RetrieveThroughputParameters type or - a IO[bytes] type. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionThroughputInfoResult or the result of cls(response) + :return: An iterator like instance of either MongoDBCollectionGetResults or the result of + cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) 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)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = 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._mongo_db_database_retrieve_throughput_distribution_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - retrieve_throughput_parameters=retrieve_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, 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.PhysicalPartitionThroughputInfoResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + cls: ClsType[_models.MongoDBCollectionListResult] = kwargs.pop("cls", None) - async def _mongo_db_database_redistribute_throughput_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1336,990 +1127,66 @@ async def _mongo_db_database_redistribute_throughput_initial( # pylint: disable } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + def prepare_request(next_link=None): + if not next_link: - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + _request = build_list_mongo_db_collections_request( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(redistribute_throughput_parameters, (IOBase, bytes)): - _content = redistribute_throughput_parameters - else: - _json = self._serialize.body(redistribute_throughput_parameters, "RedistributeThroughputParameters") + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request - _request = build_mongo_db_database_redistribute_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + async def extract_data(pipeline_response): + deserialized = self._deserialize("MongoDBCollectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return None, AsyncList(list_of_elem) - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + async def get_next(next_link=None): + _request = prepare_request(next_link) - response = pipeline_response.http_response + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_mongo_db_database_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: _models.RedistributeThroughputParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB MongoDB database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current MongoDB database. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters - :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 - PhysicalPartitionThroughputInfoResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_mongo_db_database_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB MongoDB database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current MongoDB database. Required. - :type redistribute_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionThroughputInfoResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_mongo_db_database_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB MongoDB database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current MongoDB database. Is either a RedistributeThroughputParameters type - or a IO[bytes] type. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionThroughputInfoResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :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.PhysicalPartitionThroughputInfoResult] = 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._mongo_db_database_redistribute_throughput_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - redistribute_throughput_parameters=redistribute_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, 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.PhysicalPartitionThroughputInfoResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _mongo_db_container_retrieve_throughput_distribution_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(retrieve_throughput_parameters, (IOBase, bytes)): - _content = retrieve_throughput_parameters - else: - _json = self._serialize.body(retrieve_throughput_parameters, "RetrieveThroughputParameters") - - _request = build_mongo_db_container_retrieve_throughput_distribution_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_mongo_db_container_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - retrieve_throughput_parameters: _models.RetrieveThroughputParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current MongoDB container. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - :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 - PhysicalPartitionThroughputInfoResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_mongo_db_container_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - retrieve_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current MongoDB container. Required. - :type retrieve_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionThroughputInfoResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_mongo_db_container_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current MongoDB container. Is either a RetrieveThroughputParameters type - or a IO[bytes] type. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionThroughputInfoResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :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.PhysicalPartitionThroughputInfoResult] = 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._mongo_db_container_retrieve_throughput_distribution_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - retrieve_throughput_parameters=retrieve_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, 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.PhysicalPartitionThroughputInfoResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _mongo_db_container_redistribute_throughput_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(redistribute_throughput_parameters, (IOBase, bytes)): - _content = redistribute_throughput_parameters - else: - _json = self._serialize.body(redistribute_throughput_parameters, "RedistributeThroughputParameters") - - _request = build_mongo_db_container_redistribute_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_mongo_db_container_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - redistribute_throughput_parameters: _models.RedistributeThroughputParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB MongoDB container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current MongoDB container. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters - :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 - PhysicalPartitionThroughputInfoResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_mongo_db_container_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - redistribute_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB MongoDB container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current MongoDB container. Required. - :type redistribute_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionThroughputInfoResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_mongo_db_container_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB MongoDB container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current MongoDB container. Is either a RedistributeThroughputParameters type - or a IO[bytes] type. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionThroughputInfoResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :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.PhysicalPartitionThroughputInfoResult] = 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._mongo_db_container_redistribute_throughput_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - redistribute_throughput_parameters=redistribute_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, 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.PhysicalPartitionThroughputInfoResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def list_mongo_db_collections( - self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any - ) -> AsyncIterable["_models.MongoDBCollectionGetResults"]: - """Lists the MongoDB collection under an existing Azure Cosmos DB database account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :return: An iterator like instance of either MongoDBCollectionGetResults or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] - :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.MongoDBCollectionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_mongo_db_collections_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("MongoDBCollectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get_mongo_db_collection( - self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any - ) -> _models.MongoDBCollectionGetResults: - """Gets the MongoDB collection under an existing Azure Cosmos DB database account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :return: MongoDBCollectionGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MongoDBCollectionGetResults] = kwargs.pop("cls", None) - - _request = build_get_mongo_db_collection_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("MongoDBCollectionGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_update_mongo_db_collection_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - create_update_mongo_db_collection_parameters: Union[_models.MongoDBCollectionCreateUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(create_update_mongo_db_collection_parameters, (IOBase, bytes)): - _content = create_update_mongo_db_collection_parameters - else: - _json = self._serialize.body( - create_update_mongo_db_collection_parameters, "MongoDBCollectionCreateUpdateParameters" - ) - - _request = build_create_update_mongo_db_collection_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_update_mongo_db_collection( - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - create_update_mongo_db_collection_parameters: _models.MongoDBCollectionCreateUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.MongoDBCollectionGetResults]: - """Create or update an Azure Cosmos DB MongoDB Collection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param create_update_mongo_db_collection_parameters: The parameters to provide for the current - MongoDB Collection. Required. - :type create_update_mongo_db_collection_parameters: - ~azure.mgmt.cosmosdb.models.MongoDBCollectionCreateUpdateParameters - :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 MongoDBCollectionGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_update_mongo_db_collection( - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - create_update_mongo_db_collection_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.MongoDBCollectionGetResults]: - """Create or update an Azure Cosmos DB MongoDB Collection. + return pipeline_response - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param create_update_mongo_db_collection_parameters: The parameters to provide for the current - MongoDB Collection. Required. - :type create_update_mongo_db_collection_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either MongoDBCollectionGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ + return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def begin_create_update_mongo_db_collection( - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - create_update_mongo_db_collection_parameters: Union[_models.MongoDBCollectionCreateUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.MongoDBCollectionGetResults]: - """Create or update an Azure Cosmos DB MongoDB Collection. + async def get_mongo_db_collection( + self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any + ) -> _models.MongoDBCollectionGetResults: + """Gets the MongoDB collection under an existing Azure Cosmos DB database account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2330,69 +1197,10 @@ async def begin_create_update_mongo_db_collection( :type database_name: str :param collection_name: Cosmos DB collection name. Required. :type collection_name: str - :param create_update_mongo_db_collection_parameters: The parameters to provide for the current - MongoDB Collection. Is either a MongoDBCollectionCreateUpdateParameters type or a IO[bytes] - type. Required. - :type create_update_mongo_db_collection_parameters: - ~azure.mgmt.cosmosdb.models.MongoDBCollectionCreateUpdateParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either MongoDBCollectionGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] - :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.MongoDBCollectionGetResults] = 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_update_mongo_db_collection_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - create_update_mongo_db_collection_parameters=create_update_mongo_db_collection_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("MongoDBCollectionGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.MongoDBCollectionGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.MongoDBCollectionGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_mongo_db_collection_initial( - self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: + :return: MongoDBCollectionGetResults or the result of cls(response) + :rtype: ~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -2405,9 +1213,9 @@ async def _delete_mongo_db_collection_initial( _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[AsyncIterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.MongoDBCollectionGetResults] = kwargs.pop("cls", None) - _request = build_delete_mongo_db_collection_request( + _request = build_get_mongo_db_collection_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2419,103 +1227,31 @@ async def _delete_mongo_db_collection_initial( ) _request.url = self._client.format_url(_request.url) - _decompress = kwargs.pop("decompress", True) - _stream = True + _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]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + deserialized = self._deserialize("MongoDBCollectionGetResults", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace_async - async def begin_delete_mongo_db_collection( - self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an existing Azure Cosmos DB MongoDB Collection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._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_mongo_db_collection_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _mongo_db_database_partition_merge_initial( # pylint: disable=name-too-long + async def _create_update_mongo_db_collection_initial( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, database_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], + collection_name: str, + create_update_mongo_db_collection_parameters: Union[_models.MongoDBCollectionCreateUpdateParameters, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -2536,15 +1272,18 @@ async def _mongo_db_database_partition_merge_initial( # pylint: disable=name-to content_type = content_type or "application/json" _json = None _content = None - if isinstance(merge_parameters, (IOBase, bytes)): - _content = merge_parameters + if isinstance(create_update_mongo_db_collection_parameters, (IOBase, bytes)): + _content = create_update_mongo_db_collection_parameters else: - _json = self._serialize.body(merge_parameters, "MergeParameters") + _json = self._serialize.body( + create_update_mongo_db_collection_parameters, "MongoDBCollectionCreateUpdateParameters" + ) - _request = build_mongo_db_database_partition_merge_request( + _request = build_create_update_mongo_db_collection_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, + collection_name=collection_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, @@ -2586,17 +1325,18 @@ async def _mongo_db_database_partition_merge_initial( # pylint: disable=name-to return deserialized # type: ignore @overload - async def begin_mongo_db_database_partition_merge( + async def begin_create_update_mongo_db_collection( self, resource_group_name: str, account_name: str, database_name: str, - merge_parameters: _models.MergeParameters, + collection_name: str, + create_update_mongo_db_collection_parameters: _models.MongoDBCollectionCreateUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a MongoDB database. + ) -> AsyncLROPoller[_models.MongoDBCollectionGetResults]: + """Create or update an Azure Cosmos DB MongoDB Collection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2605,30 +1345,35 @@ async def begin_mongo_db_database_partition_merge( :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters + :param collection_name: Cosmos DB collection name. Required. + :type collection_name: str + :param create_update_mongo_db_collection_parameters: The parameters to provide for the current + MongoDB Collection. Required. + :type create_update_mongo_db_collection_parameters: + ~azure.mgmt.cosmosdb.models.MongoDBCollectionCreateUpdateParameters :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 - PhysicalPartitionStorageInfoCollection or the result of cls(response) + :return: An instance of AsyncLROPoller that returns either MongoDBCollectionGetResults or the + result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_mongo_db_database_partition_merge( + async def begin_create_update_mongo_db_collection( self, resource_group_name: str, account_name: str, database_name: str, - merge_parameters: IO[bytes], + collection_name: str, + create_update_mongo_db_collection_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a MongoDB database. + ) -> AsyncLROPoller[_models.MongoDBCollectionGetResults]: + """Create or update an Azure Cosmos DB MongoDB Collection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2637,28 +1382,32 @@ async def begin_mongo_db_database_partition_merge( :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: IO[bytes] + :param collection_name: Cosmos DB collection name. Required. + :type collection_name: str + :param create_update_mongo_db_collection_parameters: The parameters to provide for the current + MongoDB Collection. Required. + :type create_update_mongo_db_collection_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionStorageInfoCollection or the result of cls(response) + :return: An instance of AsyncLROPoller that returns either MongoDBCollectionGetResults or the + result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_mongo_db_database_partition_merge( + async def begin_create_update_mongo_db_collection( self, resource_group_name: str, account_name: str, database_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], + collection_name: str, + create_update_mongo_db_collection_parameters: Union[_models.MongoDBCollectionCreateUpdateParameters, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a MongoDB database. + ) -> AsyncLROPoller[_models.MongoDBCollectionGetResults]: + """Create or update an Azure Cosmos DB MongoDB Collection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2667,13 +1416,17 @@ async def begin_mongo_db_database_partition_merge( :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param merge_parameters: The parameters for the merge operation. Is either a MergeParameters - type or a IO[bytes] type. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionStorageInfoCollection or the result of cls(response) + :param collection_name: Cosmos DB collection name. Required. + :type collection_name: str + :param create_update_mongo_db_collection_parameters: The parameters to provide for the current + MongoDB Collection. Is either a MongoDBCollectionCreateUpdateParameters type or a IO[bytes] + type. Required. + :type create_update_mongo_db_collection_parameters: + ~azure.mgmt.cosmosdb.models.MongoDBCollectionCreateUpdateParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either MongoDBCollectionGetResults or the + result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2681,16 +1434,17 @@ async def begin_mongo_db_database_partition_merge( 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.PhysicalPartitionStorageInfoCollection] = kwargs.pop("cls", None) + cls: ClsType[_models.MongoDBCollectionGetResults] = 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._mongo_db_database_partition_merge_initial( + raw_result = await self._create_update_mongo_db_collection_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, - merge_parameters=merge_parameters, + collection_name=collection_name, + create_update_mongo_db_collection_parameters=create_update_mongo_db_collection_parameters, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -2702,38 +1456,30 @@ async def begin_mongo_db_database_partition_merge( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionStorageInfoCollection", pipeline_response.http_response) + deserialized = self._deserialize("MongoDBCollectionGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection].from_continuation_token( + return AsyncLROPoller[_models.MongoDBCollectionGetResults].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]( + return AsyncLROPoller[_models.MongoDBCollectionGetResults]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _list_mongo_db_collection_partition_merge_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], - **kwargs: Any + async def _delete_mongo_db_collection_initial( + self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2743,31 +1489,19 @@ async def _list_mongo_db_collection_partition_merge_initial( # pylint: disable= } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) 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)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(merge_parameters, (IOBase, bytes)): - _content = merge_parameters - else: - _json = self._serialize.body(merge_parameters, "MergeParameters") - - _request = build_list_mongo_db_collection_partition_merge_request( + _request = build_delete_mongo_db_collection_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, collection_name=collection_name, subscription_id=self._config.subscription_id, api_version=api_version, - content_type=content_type, - json=_json, - content=_content, headers=_headers, params=_params, ) @@ -2781,7 +1515,7 @@ async def _list_mongo_db_collection_partition_merge_initial( # pylint: disable= response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [202, 204]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -2803,87 +1537,11 @@ async def _list_mongo_db_collection_partition_merge_initial( # pylint: disable= return deserialized # type: ignore - @overload - async def begin_list_mongo_db_collection_partition_merge( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - merge_parameters: _models.MergeParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a MongoDB Collection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters - :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 - PhysicalPartitionStorageInfoCollection or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_list_mongo_db_collection_partition_merge( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - merge_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a MongoDB Collection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionStorageInfoCollection or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace_async - async def begin_list_mongo_db_collection_partition_merge( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a MongoDB Collection. + async def begin_delete_mongo_db_collection( + self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an existing Azure Cosmos DB MongoDB Collection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2894,33 +1552,25 @@ async def begin_list_mongo_db_collection_partition_merge( # pylint: disable=nam :type database_name: str :param collection_name: Cosmos DB collection name. Required. :type collection_name: str - :param merge_parameters: The parameters for the merge operation. Is either a MergeParameters - type or a IO[bytes] type. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionStorageInfoCollection or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = 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.PhysicalPartitionStorageInfoCollection] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._list_mongo_db_collection_partition_merge_initial( + raw_result = await self._delete_mongo_db_collection_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, collection_name=collection_name, - merge_parameters=merge_parameters, api_version=api_version, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -2929,30 +1579,24 @@ async def begin_list_mongo_db_collection_partition_merge( # pylint: disable=nam await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionStorageInfoCollection", pipeline_response.http_response) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection].from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async async def get_mongo_db_collection_throughput( diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_network_security_perimeter_configurations_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_network_security_perimeter_configurations_operations.py deleted file mode 100644 index f3ce8502ccbd..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_network_security_perimeter_configurations_operations.py +++ /dev/null @@ -1,340 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, Optional, TypeVar, Union, cast -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._network_security_perimeter_configurations_operations import ( - build_get_request, - build_list_request, - build_reconcile_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class NetworkSecurityPerimeterConfigurationsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.aio.CosmosDBManagementClient`'s - :attr:`network_security_perimeter_configurations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> AsyncIterable["_models.NetworkSecurityPerimeterConfiguration"]: - """Gets list of effective Network Security Perimeter Configuration for cosmos db account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :return: An iterator like instance of either NetworkSecurityPerimeterConfiguration or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.NetworkSecurityPerimeterConfiguration] - :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.NetworkSecurityPerimeterConfigurationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkSecurityPerimeterConfigurationListResult", 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, - account_name: str, - network_security_perimeter_configuration_name: str, - **kwargs: Any - ) -> _models.NetworkSecurityPerimeterConfiguration: - """Gets effective Network Security Perimeter Configuration for association. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param network_security_perimeter_configuration_name: The name for Network Security Perimeter - configuration. Required. - :type network_security_perimeter_configuration_name: str - :return: NetworkSecurityPerimeterConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.NetworkSecurityPerimeterConfiguration - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkSecurityPerimeterConfiguration] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - network_security_perimeter_configuration_name=network_security_perimeter_configuration_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("NetworkSecurityPerimeterConfiguration", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _reconcile_initial( - self, - resource_group_name: str, - account_name: str, - network_security_perimeter_configuration_name: str, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_reconcile_request( - resource_group_name=resource_group_name, - account_name=account_name, - network_security_perimeter_configuration_name=network_security_perimeter_configuration_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_reconcile( - self, - resource_group_name: str, - account_name: str, - network_security_perimeter_configuration_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Refreshes any information about the association. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param network_security_perimeter_configuration_name: The name for Network Security Perimeter - configuration. Required. - :type network_security_perimeter_configuration_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._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._reconcile_initial( - resource_group_name=resource_group_name, - account_name=account_name, - network_security_perimeter_configuration_name=network_security_perimeter_configuration_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, 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/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_notebook_workspaces_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_notebook_workspaces_operations.py index e710fb09b15b..737c667cbb3a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_notebook_workspaces_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_notebook_workspaces_operations.py @@ -145,7 +145,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.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -208,7 +208,7 @@ async def get( 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.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("NotebookWorkspace", pipeline_response.http_response) @@ -277,7 +277,7 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) @@ -477,7 +477,7 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) @@ -606,7 +606,7 @@ async def list_connection_info( 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.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("NotebookWorkspaceConnectionInfoResult", pipeline_response.http_response) @@ -662,7 +662,7 @@ async def _regenerate_auth_token_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) @@ -781,7 +781,7 @@ async def _start_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_private_endpoint_connections_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_private_endpoint_connections_operations.py index 65cdd3d4b3b0..498cfcf0d028 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_private_endpoint_connections_operations.py @@ -269,7 +269,7 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) @@ -459,7 +459,7 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_service_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_service_operations.py index 98728bc99167..e48daaee152b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_service_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_service_operations.py @@ -209,10 +209,17 @@ async def _create_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("azure-AsyncOperation") + ) + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_sql_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_sql_resources_operations.py index d3a8229dad47..dbdec8c902ce 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_sql_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_sql_resources_operations.py @@ -59,7 +59,6 @@ build_get_sql_trigger_request, build_get_sql_user_defined_function_request, build_list_client_encryption_keys_request, - build_list_sql_container_partition_merge_request, build_list_sql_containers_request, build_list_sql_databases_request, build_list_sql_role_assignments_request, @@ -72,11 +71,6 @@ build_migrate_sql_database_to_autoscale_request, build_migrate_sql_database_to_manual_throughput_request, build_retrieve_continuous_backup_information_request, - build_sql_container_redistribute_throughput_request, - build_sql_container_retrieve_throughput_distribution_request, - build_sql_database_partition_merge_request, - build_sql_database_redistribute_throughput_request, - build_sql_database_retrieve_throughput_distribution_request, build_update_sql_container_throughput_request, build_update_sql_database_throughput_request, ) @@ -1110,10 +1104,10 @@ def get_long_running_output(pipeline_response): ) @distributed_trace - def list_client_encryption_keys( + def list_sql_containers( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any - ) -> AsyncIterable["_models.ClientEncryptionKeyGetResults"]: - """Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. + ) -> AsyncIterable["_models.SqlContainerGetResults"]: + """Lists the SQL container under an existing Azure Cosmos DB database account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1122,17 +1116,17 @@ def list_client_encryption_keys( :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :return: An iterator like instance of either ClientEncryptionKeyGetResults or the result of + :return: An iterator like instance of either SqlContainerGetResults or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] :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.ClientEncryptionKeysListResult] = kwargs.pop("cls", None) + cls: ClsType[_models.SqlContainerListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1145,7 +1139,7 @@ def list_client_encryption_keys( def prepare_request(next_link=None): if not next_link: - _request = build_list_client_encryption_keys_request( + _request = build_list_sql_containers_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1174,7 +1168,7 @@ def prepare_request(next_link=None): return _request async def extract_data(pipeline_response): - deserialized = self._deserialize("ClientEncryptionKeysListResult", pipeline_response) + deserialized = self._deserialize("SqlContainerListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -1198,15 +1192,10 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def get_client_encryption_key( - self, - resource_group_name: str, - account_name: str, - database_name: str, - client_encryption_key_name: str, - **kwargs: Any - ) -> _models.ClientEncryptionKeyGetResults: - """Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + async def get_sql_container( + self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any + ) -> _models.SqlContainerGetResults: + """Gets the SQL container under an existing Azure Cosmos DB database account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1215,10 +1204,10 @@ async def get_client_encryption_key( :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. - :type client_encryption_key_name: str - :return: ClientEncryptionKeyGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults + :param container_name: Cosmos DB container name. Required. + :type container_name: str + :return: SqlContainerGetResults or the result of cls(response) + :rtype: ~azure.mgmt.cosmosdb.models.SqlContainerGetResults :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1233,13 +1222,13 @@ async def get_client_encryption_key( _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.ClientEncryptionKeyGetResults] = kwargs.pop("cls", None) + cls: ClsType[_models.SqlContainerGetResults] = kwargs.pop("cls", None) - _request = build_get_client_encryption_key_request( + _request = build_get_sql_container_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, - client_encryption_key_name=client_encryption_key_name, + container_name=container_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, @@ -1258,22 +1247,20 @@ async def get_client_encryption_key( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("ClientEncryptionKeyGetResults", pipeline_response.http_response) + deserialized = self._deserialize("SqlContainerGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - async def _create_update_client_encryption_key_initial( # pylint: disable=name-too-long + async def _create_update_sql_container_initial( self, resource_group_name: str, account_name: str, database_name: str, - client_encryption_key_name: str, - create_update_client_encryption_key_parameters: Union[ - _models.ClientEncryptionKeyCreateUpdateParameters, IO[bytes] - ], + container_name: str, + create_update_sql_container_parameters: Union[_models.SqlContainerCreateUpdateParameters, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -1294,18 +1281,16 @@ async def _create_update_client_encryption_key_initial( # pylint: disable=name- content_type = content_type or "application/json" _json = None _content = None - if isinstance(create_update_client_encryption_key_parameters, (IOBase, bytes)): - _content = create_update_client_encryption_key_parameters + if isinstance(create_update_sql_container_parameters, (IOBase, bytes)): + _content = create_update_sql_container_parameters else: - _json = self._serialize.body( - create_update_client_encryption_key_parameters, "ClientEncryptionKeyCreateUpdateParameters" - ) + _json = self._serialize.body(create_update_sql_container_parameters, "SqlContainerCreateUpdateParameters") - _request = build_create_update_client_encryption_key_request( + _request = build_create_update_sql_container_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, - client_encryption_key_name=client_encryption_key_name, + container_name=container_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, @@ -1347,19 +1332,18 @@ async def _create_update_client_encryption_key_initial( # pylint: disable=name- return deserialized # type: ignore @overload - async def begin_create_update_client_encryption_key( # pylint: disable=name-too-long + async def begin_create_update_sql_container( self, resource_group_name: str, account_name: str, database_name: str, - client_encryption_key_name: str, - create_update_client_encryption_key_parameters: _models.ClientEncryptionKeyCreateUpdateParameters, + container_name: str, + create_update_sql_container_parameters: _models.SqlContainerCreateUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.ClientEncryptionKeyGetResults]: - """Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the - Azure Powershell (instead of directly). + ) -> AsyncLROPoller[_models.SqlContainerGetResults]: + """Create or update an Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1368,36 +1352,34 @@ async def begin_create_update_client_encryption_key( # pylint: disable=name-too :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. - :type client_encryption_key_name: str - :param create_update_client_encryption_key_parameters: The parameters to provide for the client - encryption key. Required. - :type create_update_client_encryption_key_parameters: - ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyCreateUpdateParameters + :param container_name: Cosmos DB container name. Required. + :type container_name: str + :param create_update_sql_container_parameters: The parameters to provide for the current SQL + container. Required. + :type create_update_sql_container_parameters: + ~azure.mgmt.cosmosdb.models.SqlContainerCreateUpdateParameters :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 ClientEncryptionKeyGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] + :return: An instance of AsyncLROPoller that returns either SqlContainerGetResults or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_update_client_encryption_key( # pylint: disable=name-too-long + async def begin_create_update_sql_container( self, resource_group_name: str, account_name: str, database_name: str, - client_encryption_key_name: str, - create_update_client_encryption_key_parameters: IO[bytes], + container_name: str, + create_update_sql_container_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.ClientEncryptionKeyGetResults]: - """Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the - Azure Powershell (instead of directly). + ) -> AsyncLROPoller[_models.SqlContainerGetResults]: + """Create or update an Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1406,35 +1388,31 @@ async def begin_create_update_client_encryption_key( # pylint: disable=name-too :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. - :type client_encryption_key_name: str - :param create_update_client_encryption_key_parameters: The parameters to provide for the client - encryption key. Required. - :type create_update_client_encryption_key_parameters: IO[bytes] + :param container_name: Cosmos DB container name. Required. + :type container_name: str + :param create_update_sql_container_parameters: The parameters to provide for the current SQL + container. Required. + :type create_update_sql_container_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either ClientEncryptionKeyGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] + :return: An instance of AsyncLROPoller that returns either SqlContainerGetResults or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_create_update_client_encryption_key( # pylint: disable=name-too-long + async def begin_create_update_sql_container( self, resource_group_name: str, account_name: str, database_name: str, - client_encryption_key_name: str, - create_update_client_encryption_key_parameters: Union[ - _models.ClientEncryptionKeyCreateUpdateParameters, IO[bytes] - ], + container_name: str, + create_update_sql_container_parameters: Union[_models.SqlContainerCreateUpdateParameters, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.ClientEncryptionKeyGetResults]: - """Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the - Azure Powershell (instead of directly). + ) -> AsyncLROPoller[_models.SqlContainerGetResults]: + """Create or update an Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1443,17 +1421,15 @@ async def begin_create_update_client_encryption_key( # pylint: disable=name-too :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. - :type client_encryption_key_name: str - :param create_update_client_encryption_key_parameters: The parameters to provide for the client - encryption key. Is either a ClientEncryptionKeyCreateUpdateParameters type or a IO[bytes] type. - Required. - :type create_update_client_encryption_key_parameters: - ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyCreateUpdateParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ClientEncryptionKeyGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] + :param container_name: Cosmos DB container name. Required. + :type container_name: str + :param create_update_sql_container_parameters: The parameters to provide for the current SQL + container. Is either a SqlContainerCreateUpdateParameters type or a IO[bytes] type. Required. + :type create_update_sql_container_parameters: + ~azure.mgmt.cosmosdb.models.SqlContainerCreateUpdateParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either SqlContainerGetResults or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1461,17 +1437,17 @@ async def begin_create_update_client_encryption_key( # pylint: disable=name-too 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.ClientEncryptionKeyGetResults] = kwargs.pop("cls", None) + cls: ClsType[_models.SqlContainerGetResults] = 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_update_client_encryption_key_initial( + raw_result = await self._create_update_sql_container_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, - client_encryption_key_name=client_encryption_key_name, - create_update_client_encryption_key_parameters=create_update_client_encryption_key_parameters, + container_name=container_name, + create_update_sql_container_parameters=create_update_sql_container_parameters, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -1483,7 +1459,7 @@ async def begin_create_update_client_encryption_key( # pylint: disable=name-too kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ClientEncryptionKeyGetResults", pipeline_response.http_response) + deserialized = self._deserialize("SqlContainerGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -1495,21 +1471,80 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.ClientEncryptionKeyGetResults].from_continuation_token( + return AsyncLROPoller[_models.SqlContainerGetResults].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.ClientEncryptionKeyGetResults]( + return AsyncLROPoller[_models.SqlContainerGetResults]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @distributed_trace - def list_sql_containers( - self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any - ) -> AsyncIterable["_models.SqlContainerGetResults"]: - """Lists the SQL container under an existing Azure Cosmos DB database account. + async def _delete_sql_container_initial( + self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_delete_sql_container_request( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + container_name=container_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("azure-AsyncOperation") + ) + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete_sql_container( + self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an existing Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1518,86 +1553,60 @@ def list_sql_containers( :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :return: An iterator like instance of either SqlContainerGetResults or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] + :param container_name: Cosmos DB container name. Required. + :type container_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlContainerListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_sql_containers_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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_sql_container_initial( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + container_name=container_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - async def extract_data(pipeline_response): - deserialized = self._deserialize("SqlContainerListResult", pipeline_response) - list_of_elem = deserialized.value + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) + return cls(pipeline_response, None, {}) # type: ignore - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async - async def get_sql_container( + async def get_sql_container_throughput( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> _models.SqlContainerGetResults: - """Gets the SQL container under an existing Azure Cosmos DB database account. + ) -> _models.ThroughputSettingsGetResults: + """Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database + account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1608,8 +1617,8 @@ async def get_sql_container( :type database_name: str :param container_name: Cosmos DB container name. Required. :type container_name: str - :return: SqlContainerGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.SqlContainerGetResults + :return: ThroughputSettingsGetResults or the result of cls(response) + :rtype: ~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1624,9 +1633,9 @@ async def get_sql_container( _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.SqlContainerGetResults] = kwargs.pop("cls", None) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) - _request = build_get_sql_container_request( + _request = build_get_sql_container_throughput_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1649,20 +1658,20 @@ async def get_sql_container( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("SqlContainerGetResults", pipeline_response.http_response) + deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - async def _create_update_sql_container_initial( + async def _update_sql_container_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, - create_update_sql_container_parameters: Union[_models.SqlContainerCreateUpdateParameters, IO[bytes]], + update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -1683,12 +1692,12 @@ async def _create_update_sql_container_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(create_update_sql_container_parameters, (IOBase, bytes)): - _content = create_update_sql_container_parameters + if isinstance(update_throughput_parameters, (IOBase, bytes)): + _content = update_throughput_parameters else: - _json = self._serialize.body(create_update_sql_container_parameters, "SqlContainerCreateUpdateParameters") + _json = self._serialize.body(update_throughput_parameters, "ThroughputSettingsUpdateParameters") - _request = build_create_update_sql_container_request( + _request = build_update_sql_container_throughput_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1734,18 +1743,18 @@ async def _create_update_sql_container_initial( return deserialized # type: ignore @overload - async def begin_create_update_sql_container( + async def begin_update_sql_container_throughput( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, - create_update_sql_container_parameters: _models.SqlContainerCreateUpdateParameters, + update_throughput_parameters: _models.ThroughputSettingsUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.SqlContainerGetResults]: - """Create or update an Azure Cosmos DB SQL container. + ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: + """Update RUs per second of an Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1756,32 +1765,33 @@ async def begin_create_update_sql_container( :type database_name: str :param container_name: Cosmos DB container name. Required. :type container_name: str - :param create_update_sql_container_parameters: The parameters to provide for the current SQL - container. Required. - :type create_update_sql_container_parameters: - ~azure.mgmt.cosmosdb.models.SqlContainerCreateUpdateParameters + :param update_throughput_parameters: The parameters to provide for the RUs per second of the + current SQL container. Required. + :type update_throughput_parameters: + ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters :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 SqlContainerGetResults or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] + :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_update_sql_container( + async def begin_update_sql_container_throughput( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, - create_update_sql_container_parameters: IO[bytes], + update_throughput_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.SqlContainerGetResults]: - """Create or update an Azure Cosmos DB SQL container. + ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: + """Update RUs per second of an Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1792,29 +1802,30 @@ async def begin_create_update_sql_container( :type database_name: str :param container_name: Cosmos DB container name. Required. :type container_name: str - :param create_update_sql_container_parameters: The parameters to provide for the current SQL - container. Required. - :type create_update_sql_container_parameters: IO[bytes] + :param update_throughput_parameters: The parameters to provide for the RUs per second of the + current SQL container. Required. + :type update_throughput_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either SqlContainerGetResults or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] + :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_create_update_sql_container( + async def begin_update_sql_container_throughput( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, - create_update_sql_container_parameters: Union[_models.SqlContainerCreateUpdateParameters, IO[bytes]], + update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.SqlContainerGetResults]: - """Create or update an Azure Cosmos DB SQL container. + ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: + """Update RUs per second of an Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1825,13 +1836,15 @@ async def begin_create_update_sql_container( :type database_name: str :param container_name: Cosmos DB container name. Required. :type container_name: str - :param create_update_sql_container_parameters: The parameters to provide for the current SQL - container. Is either a SqlContainerCreateUpdateParameters type or a IO[bytes] type. Required. - :type create_update_sql_container_parameters: - ~azure.mgmt.cosmosdb.models.SqlContainerCreateUpdateParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either SqlContainerGetResults or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] + :param update_throughput_parameters: The parameters to provide for the RUs per second of the + current SQL container. Is either a ThroughputSettingsUpdateParameters type or a IO[bytes] type. + Required. + :type update_throughput_parameters: + ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1839,17 +1852,17 @@ async def begin_create_update_sql_container( 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.SqlContainerGetResults] = kwargs.pop("cls", None) + cls: ClsType[_models.ThroughputSettingsGetResults] = 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_update_sql_container_initial( + raw_result = await self._update_sql_container_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, container_name=container_name, - create_update_sql_container_parameters=create_update_sql_container_parameters, + update_throughput_parameters=update_throughput_parameters, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -1861,7 +1874,7 @@ async def begin_create_update_sql_container( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SqlContainerGetResults", pipeline_response.http_response) + deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -1873,17 +1886,17 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.SqlContainerGetResults].from_continuation_token( + return AsyncLROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.SqlContainerGetResults]( + return AsyncLROPoller[_models.ThroughputSettingsGetResults]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _delete_sql_container_initial( + async def _migrate_sql_container_to_autoscale_initial( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -1900,7 +1913,7 @@ async def _delete_sql_container_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_delete_sql_container_request( + _request = build_migrate_sql_container_to_autoscale_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1920,7 +1933,7 @@ async def _delete_sql_container_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -1943,10 +1956,10 @@ async def _delete_sql_container_initial( return deserialized # type: ignore @distributed_trace_async - async def begin_delete_sql_container( + async def begin_migrate_sql_container_to_autoscale( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an existing Azure Cosmos DB SQL container. + ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: + """Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1957,20 +1970,22 @@ async def begin_delete_sql_container( :type database_name: str :param container_name: Cosmos DB container name. Required. :type container_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] :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) + cls: ClsType[_models.ThroughputSettingsGetResults] = 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_sql_container_initial( + raw_result = await self._migrate_sql_container_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1984,9 +1999,11 @@ async def begin_delete_sql_container( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1995,21 +2012,18 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller[None].from_continuation_token( + return AsyncLROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + return AsyncLROPoller[_models.ThroughputSettingsGetResults]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - async def _sql_database_partition_merge_initial( - self, - resource_group_name: str, - account_name: str, - database_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], - **kwargs: Any + async def _migrate_sql_container_to_manual_throughput_initial( # pylint: disable=name-too-long + self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2019,30 +2033,19 @@ async def _sql_database_partition_merge_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) 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)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(merge_parameters, (IOBase, bytes)): - _content = merge_parameters - else: - _json = self._serialize.body(merge_parameters, "MergeParameters") - - _request = build_sql_database_partition_merge_request( + _request = build_migrate_sql_container_to_manual_throughput_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, + container_name=container_name, subscription_id=self._config.subscription_id, api_version=api_version, - content_type=content_type, - json=_json, - content=_content, headers=_headers, params=_params, ) @@ -2078,1523 +2081,11 @@ async def _sql_database_partition_merge_initial( return deserialized # type: ignore - @overload - async def begin_sql_database_partition_merge( - self, - resource_group_name: str, - account_name: str, - database_name: str, - merge_parameters: _models.MergeParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters - :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 - PhysicalPartitionStorageInfoCollection or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_sql_database_partition_merge( - self, - resource_group_name: str, - account_name: str, - database_name: str, - merge_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionStorageInfoCollection or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_sql_database_partition_merge( - self, - resource_group_name: str, - account_name: str, - database_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param merge_parameters: The parameters for the merge operation. Is either a MergeParameters - type or a IO[bytes] type. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionStorageInfoCollection or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :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.PhysicalPartitionStorageInfoCollection] = 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._sql_database_partition_merge_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - merge_parameters=merge_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionStorageInfoCollection", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, 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.PhysicalPartitionStorageInfoCollection].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _list_sql_container_partition_merge_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(merge_parameters, (IOBase, bytes)): - _content = merge_parameters - else: - _json = self._serialize.body(merge_parameters, "MergeParameters") - - _request = build_list_sql_container_partition_merge_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_list_sql_container_partition_merge( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - merge_parameters: _models.MergeParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a SQL Container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters - :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 - PhysicalPartitionStorageInfoCollection or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_list_sql_container_partition_merge( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - merge_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a SQL Container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionStorageInfoCollection or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_list_sql_container_partition_merge( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a SQL Container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param merge_parameters: The parameters for the merge operation. Is either a MergeParameters - type or a IO[bytes] type. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionStorageInfoCollection or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :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.PhysicalPartitionStorageInfoCollection] = 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_sql_container_partition_merge_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - merge_parameters=merge_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionStorageInfoCollection", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, 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.PhysicalPartitionStorageInfoCollection].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace_async - async def get_sql_container_throughput( - self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> _models.ThroughputSettingsGetResults: - """Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database - account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :return: ThroughputSettingsGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) - - _request = build_get_sql_container_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _update_sql_container_throughput_initial( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(update_throughput_parameters, (IOBase, bytes)): - _content = update_throughput_parameters - else: - _json = self._serialize.body(update_throughput_parameters, "ThroughputSettingsUpdateParameters") - - _request = build_update_sql_container_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update_sql_container_throughput( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - update_throughput_parameters: _models.ThroughputSettingsUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB SQL container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param update_throughput_parameters: The parameters to provide for the RUs per second of the - current SQL container. Required. - :type update_throughput_parameters: - ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters - :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 ThroughputSettingsGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_sql_container_throughput( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - update_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB SQL container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param update_throughput_parameters: The parameters to provide for the RUs per second of the - current SQL container. Required. - :type update_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_sql_container_throughput( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB SQL container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param update_throughput_parameters: The parameters to provide for the RUs per second of the - current SQL container. Is either a ThroughputSettingsUpdateParameters type or a IO[bytes] type. - Required. - :type update_throughput_parameters: - ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :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.ThroughputSettingsGetResults] = 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_sql_container_throughput_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - update_throughput_parameters=update_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ThroughputSettingsGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _migrate_sql_container_to_autoscale_initial( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_migrate_sql_container_to_autoscale_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_migrate_sql_container_to_autoscale( - self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: - """Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :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.ThroughputSettingsGetResults] = 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._migrate_sql_container_to_autoscale_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ThroughputSettingsGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _migrate_sql_container_to_manual_throughput_initial( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_migrate_sql_container_to_manual_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_migrate_sql_container_to_manual_throughput( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: - """Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :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.ThroughputSettingsGetResults] = 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._migrate_sql_container_to_manual_throughput_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ThroughputSettingsGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _sql_database_retrieve_throughput_distribution_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(retrieve_throughput_parameters, (IOBase, bytes)): - _content = retrieve_throughput_parameters - else: - _json = self._serialize.body(retrieve_throughput_parameters, "RetrieveThroughputParameters") - - _request = build_sql_database_retrieve_throughput_distribution_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_sql_database_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: _models.RetrieveThroughputParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current SQL database. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - :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 - PhysicalPartitionThroughputInfoResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_sql_database_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current SQL database. Required. - :type retrieve_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionThroughputInfoResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_sql_database_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current SQL database. Is either a RetrieveThroughputParameters type or a - IO[bytes] type. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionThroughputInfoResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :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.PhysicalPartitionThroughputInfoResult] = 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._sql_database_retrieve_throughput_distribution_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - retrieve_throughput_parameters=retrieve_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, 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.PhysicalPartitionThroughputInfoResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _sql_database_redistribute_throughput_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(redistribute_throughput_parameters, (IOBase, bytes)): - _content = redistribute_throughput_parameters - else: - _json = self._serialize.body(redistribute_throughput_parameters, "RedistributeThroughputParameters") - - _request = build_sql_database_redistribute_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_sql_database_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: _models.RedistributeThroughputParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current SQL database. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters - :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 - PhysicalPartitionThroughputInfoResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_sql_database_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current SQL database. Required. - :type redistribute_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionThroughputInfoResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_sql_database_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current SQL database. Is either a RedistributeThroughputParameters type or a - IO[bytes] type. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionThroughputInfoResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :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.PhysicalPartitionThroughputInfoResult] = 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._sql_database_redistribute_throughput_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - redistribute_throughput_parameters=redistribute_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, 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.PhysicalPartitionThroughputInfoResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _sql_container_retrieve_throughput_distribution_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(retrieve_throughput_parameters, (IOBase, bytes)): - _content = retrieve_throughput_parameters - else: - _json = self._serialize.body(retrieve_throughput_parameters, "RetrieveThroughputParameters") - - _request = build_sql_container_retrieve_throughput_distribution_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_sql_container_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - retrieve_throughput_parameters: _models.RetrieveThroughputParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB SQL container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current SQL container. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - :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 - PhysicalPartitionThroughputInfoResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_sql_container_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - retrieve_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB SQL container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current SQL container. Required. - :type retrieve_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionThroughputInfoResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace_async - async def begin_sql_container_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB SQL container. + async def begin_migrate_sql_container_to_manual_throughput( # pylint: disable=name-too-long + self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: + """Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3605,35 +2096,27 @@ async def begin_sql_container_retrieve_throughput_distribution( # pylint: disab :type database_name: str :param container_name: Cosmos DB container name. Required. :type container_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current SQL container. Is either a RetrieveThroughputParameters type or a - IO[bytes] type. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionThroughputInfoResult or the result of cls(response) + :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the + result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) 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)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) + cls: ClsType[_models.ThroughputSettingsGetResults] = 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._sql_container_retrieve_throughput_distribution_initial( + raw_result = await self._migrate_sql_container_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, container_name=container_name, - retrieve_throughput_parameters=retrieve_throughput_parameters, api_version=api_version, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -3643,37 +2126,193 @@ async def begin_sql_container_retrieve_throughput_distribution( # pylint: disab kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) + deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult].from_continuation_token( + return AsyncLROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]( + return AsyncLROPoller[_models.ThroughputSettingsGetResults]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _sql_container_redistribute_throughput_initial( # pylint: disable=name-too-long + @distributed_trace + def list_client_encryption_keys( + self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ClientEncryptionKeyGetResults"]: + """Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. Required. + :type account_name: str + :param database_name: Cosmos DB database name. Required. + :type database_name: str + :return: An iterator like instance of either ClientEncryptionKeyGetResults or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] + :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.ClientEncryptionKeysListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_client_encryption_keys_request( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ClientEncryptionKeysListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get_client_encryption_key( self, resource_group_name: str, account_name: str, database_name: str, - container_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], + client_encryption_key_name: str, + **kwargs: Any + ) -> _models.ClientEncryptionKeyGetResults: + """Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. Required. + :type account_name: str + :param database_name: Cosmos DB database name. Required. + :type database_name: str + :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. + :type client_encryption_key_name: str + :return: ClientEncryptionKeyGetResults or the result of cls(response) + :rtype: ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ClientEncryptionKeyGetResults] = kwargs.pop("cls", None) + + _request = build_get_client_encryption_key_request( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + client_encryption_key_name=client_encryption_key_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ClientEncryptionKeyGetResults", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_update_client_encryption_key_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + account_name: str, + database_name: str, + client_encryption_key_name: str, + create_update_client_encryption_key_parameters: Union[ + _models.ClientEncryptionKeyCreateUpdateParameters, IO[bytes] + ], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -3694,16 +2333,18 @@ async def _sql_container_redistribute_throughput_initial( # pylint: disable=nam content_type = content_type or "application/json" _json = None _content = None - if isinstance(redistribute_throughput_parameters, (IOBase, bytes)): - _content = redistribute_throughput_parameters + if isinstance(create_update_client_encryption_key_parameters, (IOBase, bytes)): + _content = create_update_client_encryption_key_parameters else: - _json = self._serialize.body(redistribute_throughput_parameters, "RedistributeThroughputParameters") + _json = self._serialize.body( + create_update_client_encryption_key_parameters, "ClientEncryptionKeyCreateUpdateParameters" + ) - _request = build_sql_container_redistribute_throughput_request( + _request = build_create_update_client_encryption_key_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, - container_name=container_name, + client_encryption_key_name=client_encryption_key_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, @@ -3745,18 +2386,19 @@ async def _sql_container_redistribute_throughput_initial( # pylint: disable=nam return deserialized # type: ignore @overload - async def begin_sql_container_redistribute_throughput( # pylint: disable=name-too-long + async def begin_create_update_client_encryption_key( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, database_name: str, - container_name: str, - redistribute_throughput_parameters: _models.RedistributeThroughputParameters, + client_encryption_key_name: str, + create_update_client_encryption_key_parameters: _models.ClientEncryptionKeyCreateUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB SQL container. + ) -> AsyncLROPoller[_models.ClientEncryptionKeyGetResults]: + """Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the + Azure Powershell (instead of directly). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3765,35 +2407,36 @@ async def begin_sql_container_redistribute_throughput( # pylint: disable=name-t :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current SQL container. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters + :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. + :type client_encryption_key_name: str + :param create_update_client_encryption_key_parameters: The parameters to provide for the client + encryption key. Required. + :type create_update_client_encryption_key_parameters: + ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyCreateUpdateParameters :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 - PhysicalPartitionThroughputInfoResult or the result of cls(response) + :return: An instance of AsyncLROPoller that returns either ClientEncryptionKeyGetResults or the + result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_sql_container_redistribute_throughput( # pylint: disable=name-too-long + async def begin_create_update_client_encryption_key( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, database_name: str, - container_name: str, - redistribute_throughput_parameters: IO[bytes], + client_encryption_key_name: str, + create_update_client_encryption_key_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB SQL container. + ) -> AsyncLROPoller[_models.ClientEncryptionKeyGetResults]: + """Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the + Azure Powershell (instead of directly). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3802,32 +2445,35 @@ async def begin_sql_container_redistribute_throughput( # pylint: disable=name-t :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current SQL container. Required. - :type redistribute_throughput_parameters: IO[bytes] + :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. + :type client_encryption_key_name: str + :param create_update_client_encryption_key_parameters: The parameters to provide for the client + encryption key. Required. + :type create_update_client_encryption_key_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionThroughputInfoResult or the result of cls(response) + :return: An instance of AsyncLROPoller that returns either ClientEncryptionKeyGetResults or the + result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_sql_container_redistribute_throughput( # pylint: disable=name-too-long + async def begin_create_update_client_encryption_key( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, database_name: str, - container_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], + client_encryption_key_name: str, + create_update_client_encryption_key_parameters: Union[ + _models.ClientEncryptionKeyCreateUpdateParameters, IO[bytes] + ], **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB SQL container. + ) -> AsyncLROPoller[_models.ClientEncryptionKeyGetResults]: + """Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the + Azure Powershell (instead of directly). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3836,17 +2482,17 @@ async def begin_sql_container_redistribute_throughput( # pylint: disable=name-t :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current SQL container. Is either a RedistributeThroughputParameters type or - a IO[bytes] type. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionThroughputInfoResult or the result of cls(response) + :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. + :type client_encryption_key_name: str + :param create_update_client_encryption_key_parameters: The parameters to provide for the client + encryption key. Is either a ClientEncryptionKeyCreateUpdateParameters type or a IO[bytes] type. + Required. + :type create_update_client_encryption_key_parameters: + ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyCreateUpdateParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ClientEncryptionKeyGetResults or the + result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3854,17 +2500,17 @@ async def begin_sql_container_redistribute_throughput( # pylint: disable=name-t 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.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) + cls: ClsType[_models.ClientEncryptionKeyGetResults] = 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._sql_container_redistribute_throughput_initial( + raw_result = await self._create_update_client_encryption_key_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, - container_name=container_name, - redistribute_throughput_parameters=redistribute_throughput_parameters, + client_encryption_key_name=client_encryption_key_name, + create_update_client_encryption_key_parameters=create_update_client_encryption_key_parameters, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -3876,27 +2522,25 @@ async def begin_sql_container_redistribute_throughput( # pylint: disable=name-t kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) + deserialized = self._deserialize("ClientEncryptionKeyGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult].from_continuation_token( + return AsyncLROPoller[_models.ClientEncryptionKeyGetResults].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]( + return AsyncLROPoller[_models.ClientEncryptionKeyGetResults]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_table_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_table_resources_operations.py index 384c66e2ca66..aaa4361f441c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_table_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_table_resources_operations.py @@ -34,17 +34,9 @@ from ... import models as _models from ...operations._table_resources_operations import ( build_create_update_table_request, - build_create_update_table_role_assignment_request, - build_create_update_table_role_definition_request, build_delete_table_request, - build_delete_table_role_assignment_request, - build_delete_table_role_definition_request, build_get_table_request, - build_get_table_role_assignment_request, - build_get_table_role_definition_request, build_get_table_throughput_request, - build_list_table_role_assignments_request, - build_list_table_role_definitions_request, build_list_tables_request, build_migrate_table_to_autoscale_request, build_migrate_table_to_manual_throughput_request, @@ -60,7 +52,7 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class TableResourcesOperations: # pylint: disable=too-many-public-methods +class TableResourcesOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -1281,973 +1273,3 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller[_models.BackupInformation]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - - @distributed_trace_async - async def get_table_role_definition( - self, resource_group_name: str, account_name: str, role_definition_id: str, **kwargs: Any - ) -> _models.TableRoleDefinitionResource: - """Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given - Id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param role_definition_id: The GUID for the Role Definition. Required. - :type role_definition_id: str - :return: TableRoleDefinitionResource or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.TableRoleDefinitionResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.TableRoleDefinitionResource] = kwargs.pop("cls", None) - - _request = build_get_table_role_definition_request( - resource_group_name=resource_group_name, - account_name=account_name, - role_definition_id=role_definition_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("TableRoleDefinitionResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_update_table_role_definition_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - role_definition_id: str, - create_update_table_role_definition_parameters: Union[_models.TableRoleDefinitionResource, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(create_update_table_role_definition_parameters, (IOBase, bytes)): - _content = create_update_table_role_definition_parameters - else: - _json = self._serialize.body(create_update_table_role_definition_parameters, "TableRoleDefinitionResource") - - _request = build_create_update_table_role_definition_request( - resource_group_name=resource_group_name, - account_name=account_name, - role_definition_id=role_definition_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - 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["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_update_table_role_definition( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - role_definition_id: str, - create_update_table_role_definition_parameters: _models.TableRoleDefinitionResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.TableRoleDefinitionResource]: - """Creates or updates an Azure Cosmos DB Table Role Definition. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param role_definition_id: The GUID for the Role Definition. Required. - :type role_definition_id: str - :param create_update_table_role_definition_parameters: The properties required to create or - update a Role Definition. Required. - :type create_update_table_role_definition_parameters: - ~azure.mgmt.cosmosdb.models.TableRoleDefinitionResource - :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 TableRoleDefinitionResource or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.TableRoleDefinitionResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_update_table_role_definition( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - role_definition_id: str, - create_update_table_role_definition_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.TableRoleDefinitionResource]: - """Creates or updates an Azure Cosmos DB Table Role Definition. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param role_definition_id: The GUID for the Role Definition. Required. - :type role_definition_id: str - :param create_update_table_role_definition_parameters: The properties required to create or - update a Role Definition. Required. - :type create_update_table_role_definition_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either TableRoleDefinitionResource or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.TableRoleDefinitionResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_update_table_role_definition( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - role_definition_id: str, - create_update_table_role_definition_parameters: Union[_models.TableRoleDefinitionResource, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.TableRoleDefinitionResource]: - """Creates or updates an Azure Cosmos DB Table Role Definition. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param role_definition_id: The GUID for the Role Definition. Required. - :type role_definition_id: str - :param create_update_table_role_definition_parameters: The properties required to create or - update a Role Definition. Is either a TableRoleDefinitionResource type or a IO[bytes] type. - Required. - :type create_update_table_role_definition_parameters: - ~azure.mgmt.cosmosdb.models.TableRoleDefinitionResource or IO[bytes] - :return: An instance of AsyncLROPoller that returns either TableRoleDefinitionResource or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.TableRoleDefinitionResource] - :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.TableRoleDefinitionResource] = 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_update_table_role_definition_initial( - resource_group_name=resource_group_name, - account_name=account_name, - role_definition_id=role_definition_id, - create_update_table_role_definition_parameters=create_update_table_role_definition_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("TableRoleDefinitionResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.TableRoleDefinitionResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.TableRoleDefinitionResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_table_role_definition_initial( - self, resource_group_name: str, account_name: str, role_definition_id: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_table_role_definition_request( - resource_group_name=resource_group_name, - account_name=account_name, - role_definition_id=role_definition_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete_table_role_definition( - self, resource_group_name: str, account_name: str, role_definition_id: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an existing Azure Cosmos DB Table Role Definition. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param role_definition_id: The GUID for the Role Definition. Required. - :type role_definition_id: 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_table_role_definition_initial( - resource_group_name=resource_group_name, - account_name=account_name, - role_definition_id=role_definition_id, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_table_role_definitions( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> AsyncIterable["_models.TableRoleDefinitionResource"]: - """Retrieves the list of all Azure Cosmos DB Table Role Definitions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :return: An iterator like instance of either TableRoleDefinitionResource or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.TableRoleDefinitionResource] - :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.TableRoleDefinitionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_table_role_definitions_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("TableRoleDefinitionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - 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_table_role_assignment( - self, resource_group_name: str, account_name: str, role_assignment_id: str, **kwargs: Any - ) -> _models.TableRoleAssignmentResource: - """Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given - Id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param role_assignment_id: The GUID for the Role Assignment. Required. - :type role_assignment_id: str - :return: TableRoleAssignmentResource or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.TableRoleAssignmentResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.TableRoleAssignmentResource] = kwargs.pop("cls", None) - - _request = build_get_table_role_assignment_request( - resource_group_name=resource_group_name, - account_name=account_name, - role_assignment_id=role_assignment_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("TableRoleAssignmentResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_update_table_role_assignment_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - role_assignment_id: str, - create_update_table_role_assignment_parameters: Union[_models.TableRoleAssignmentResource, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(create_update_table_role_assignment_parameters, (IOBase, bytes)): - _content = create_update_table_role_assignment_parameters - else: - _json = self._serialize.body(create_update_table_role_assignment_parameters, "TableRoleAssignmentResource") - - _request = build_create_update_table_role_assignment_request( - resource_group_name=resource_group_name, - account_name=account_name, - role_assignment_id=role_assignment_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - 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["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_update_table_role_assignment( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - role_assignment_id: str, - create_update_table_role_assignment_parameters: _models.TableRoleAssignmentResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.TableRoleAssignmentResource]: - """Creates or updates an Azure Cosmos DB Table Role Assignment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param role_assignment_id: The GUID for the Role Assignment. Required. - :type role_assignment_id: str - :param create_update_table_role_assignment_parameters: The properties required to create or - update a Role Assignment. Required. - :type create_update_table_role_assignment_parameters: - ~azure.mgmt.cosmosdb.models.TableRoleAssignmentResource - :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 TableRoleAssignmentResource or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.TableRoleAssignmentResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_update_table_role_assignment( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - role_assignment_id: str, - create_update_table_role_assignment_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.TableRoleAssignmentResource]: - """Creates or updates an Azure Cosmos DB Table Role Assignment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param role_assignment_id: The GUID for the Role Assignment. Required. - :type role_assignment_id: str - :param create_update_table_role_assignment_parameters: The properties required to create or - update a Role Assignment. Required. - :type create_update_table_role_assignment_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either TableRoleAssignmentResource or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.TableRoleAssignmentResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_update_table_role_assignment( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - role_assignment_id: str, - create_update_table_role_assignment_parameters: Union[_models.TableRoleAssignmentResource, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.TableRoleAssignmentResource]: - """Creates or updates an Azure Cosmos DB Table Role Assignment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param role_assignment_id: The GUID for the Role Assignment. Required. - :type role_assignment_id: str - :param create_update_table_role_assignment_parameters: The properties required to create or - update a Role Assignment. Is either a TableRoleAssignmentResource type or a IO[bytes] type. - Required. - :type create_update_table_role_assignment_parameters: - ~azure.mgmt.cosmosdb.models.TableRoleAssignmentResource or IO[bytes] - :return: An instance of AsyncLROPoller that returns either TableRoleAssignmentResource or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.TableRoleAssignmentResource] - :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.TableRoleAssignmentResource] = 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_update_table_role_assignment_initial( - resource_group_name=resource_group_name, - account_name=account_name, - role_assignment_id=role_assignment_id, - create_update_table_role_assignment_parameters=create_update_table_role_assignment_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("TableRoleAssignmentResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.TableRoleAssignmentResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.TableRoleAssignmentResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_table_role_assignment_initial( - self, resource_group_name: str, account_name: str, role_assignment_id: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_table_role_assignment_request( - resource_group_name=resource_group_name, - account_name=account_name, - role_assignment_id=role_assignment_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete_table_role_assignment( - self, resource_group_name: str, account_name: str, role_assignment_id: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an existing Azure Cosmos DB Table Role Assignment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param role_assignment_id: The GUID for the Role Assignment. Required. - :type role_assignment_id: 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_table_role_assignment_initial( - resource_group_name=resource_group_name, - account_name=account_name, - role_assignment_id=role_assignment_id, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_table_role_assignments( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> AsyncIterable["_models.TableRoleAssignmentResource"]: - """Retrieves the list of all Azure Cosmos DB Table Role Assignments. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :return: An iterator like instance of either TableRoleAssignmentResource or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.TableRoleAssignmentResource] - :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.TableRoleAssignmentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_table_role_assignments_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("TableRoleAssignmentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pool_account_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pool_account_operations.py deleted file mode 100644 index 41e2799c5e6e..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pool_account_operations.py +++ /dev/null @@ -1,459 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._throughput_pool_account_operations import ( - build_create_request, - build_delete_request, - build_get_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ThroughputPoolAccountOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.aio.CosmosDBManagementClient`'s - :attr:`throughput_pool_account` 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_async - async def get( - self, resource_group_name: str, throughput_pool_name: str, throughput_pool_account_name: str, **kwargs: Any - ) -> _models.ThroughputPoolAccountResource: - """Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param throughput_pool_account_name: Cosmos DB global database account in a Throughput Pool. - Required. - :type throughput_pool_account_name: str - :return: ThroughputPoolAccountResource or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputPoolAccountResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - throughput_pool_account_name=throughput_pool_account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ThroughputPoolAccountResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_initial( - self, - resource_group_name: str, - throughput_pool_name: str, - throughput_pool_account_name: str, - body: Union[_models.ThroughputPoolAccountResource, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "ThroughputPoolAccountResource") - - _request = build_create_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - throughput_pool_account_name=throughput_pool_account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create( - self, - resource_group_name: str, - throughput_pool_name: str, - throughput_pool_account_name: str, - body: _models.ThroughputPoolAccountResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputPoolAccountResource]: - """Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred - when performing updates on an account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param throughput_pool_account_name: Cosmos DB global database account in a Throughput Pool. - Required. - :type throughput_pool_account_name: str - :param body: The parameters to provide for the current ThroughputPoolAccount. Required. - :type body: ~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource - :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 ThroughputPoolAccountResource or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - throughput_pool_name: str, - throughput_pool_account_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputPoolAccountResource]: - """Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred - when performing updates on an account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param throughput_pool_account_name: Cosmos DB global database account in a Throughput Pool. - Required. - :type throughput_pool_account_name: str - :param body: The parameters to provide for the current ThroughputPoolAccount. 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 ThroughputPoolAccountResource or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - throughput_pool_name: str, - throughput_pool_account_name: str, - body: Union[_models.ThroughputPoolAccountResource, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputPoolAccountResource]: - """Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred - when performing updates on an account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param throughput_pool_account_name: Cosmos DB global database account in a Throughput Pool. - Required. - :type throughput_pool_account_name: str - :param body: The parameters to provide for the current ThroughputPoolAccount. Is either a - ThroughputPoolAccountResource type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ThroughputPoolAccountResource or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource] - :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.ThroughputPoolAccountResource] = 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, - throughput_pool_name=throughput_pool_name, - throughput_pool_account_name=throughput_pool_account_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputPoolAccountResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, 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.ThroughputPoolAccountResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ThroughputPoolAccountResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, throughput_pool_name: str, throughput_pool_account_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - throughput_pool_account_name=throughput_pool_account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - 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["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - 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, throughput_pool_name: str, throughput_pool_account_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Removes an existing Azure Cosmos DB database account from a throughput pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param throughput_pool_account_name: Cosmos DB global database account in a Throughput Pool. - Required. - :type throughput_pool_account_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._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( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - throughput_pool_account_name=throughput_pool_account_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pool_accounts_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pool_accounts_operations.py deleted file mode 100644 index 16288dae2da8..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pool_accounts_operations.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._throughput_pool_accounts_operations import build_list_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ThroughputPoolAccountsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.aio.CosmosDBManagementClient`'s - :attr:`throughput_pool_accounts` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, throughput_pool_name: str, **kwargs: Any - ) -> AsyncIterable["_models.ThroughputPoolAccountResource"]: - """Lists all the Azure Cosmos DB accounts available under the subscription. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :return: An iterator like instance of either ThroughputPoolAccountResource or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource] - :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.ThroughputPoolAccountsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ThroughputPoolAccountsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pool_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pool_operations.py deleted file mode 100644 index ec5b7d6995ea..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pool_operations.py +++ /dev/null @@ -1,639 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._throughput_pool_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_update_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ThroughputPoolOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.aio.CosmosDBManagementClient`'s - :attr:`throughput_pool` 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_async - async def get( - self, resource_group_name: str, throughput_pool_name: str, **kwargs: Any - ) -> _models.ThroughputPoolResource: - """Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :return: ThroughputPoolResource or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.ThroughputPoolResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputPoolResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ThroughputPoolResource", pipeline_response.http_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, - throughput_pool_name: str, - body: Union[_models.ThroughputPoolResource, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "ThroughputPoolResource") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - throughput_pool_name: str, - body: _models.ThroughputPoolResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputPoolResource]: - """Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred - when performing updates on an account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param body: The parameters to provide for the current ThroughputPool. Required. - :type body: ~azure.mgmt.cosmosdb.models.ThroughputPoolResource - :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 ThroughputPoolResource or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - throughput_pool_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputPoolResource]: - """Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred - when performing updates on an account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param body: The parameters to provide for the current ThroughputPool. 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 ThroughputPoolResource or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - throughput_pool_name: str, - body: Union[_models.ThroughputPoolResource, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputPoolResource]: - """Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred - when performing updates on an account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param body: The parameters to provide for the current ThroughputPool. Is either a - ThroughputPoolResource type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.cosmosdb.models.ThroughputPoolResource or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ThroughputPoolResource or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :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.ThroughputPoolResource] = 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, - throughput_pool_name=throughput_pool_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputPoolResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, 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.ThroughputPoolResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ThroughputPoolResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - throughput_pool_name: str, - body: Optional[Union[_models.ThroughputPoolUpdate, IO[bytes]]] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _json = self._serialize.body(body, "ThroughputPoolUpdate") - else: - _json = None - - _request = build_update_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - 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["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - 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, - throughput_pool_name: str, - body: Optional[_models.ThroughputPoolUpdate] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputPoolResource]: - """Updates the properties of an existing Azure Cosmos DB Throughput Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param body: The parameters to provide for the current Throughput Pool. Default value is None. - :type body: ~azure.mgmt.cosmosdb.models.ThroughputPoolUpdate - :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 ThroughputPoolResource or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - throughput_pool_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputPoolResource]: - """Updates the properties of an existing Azure Cosmos DB Throughput Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param body: The parameters to provide for the current Throughput Pool. Default value is None. - :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 ThroughputPoolResource or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - throughput_pool_name: str, - body: Optional[Union[_models.ThroughputPoolUpdate, IO[bytes]]] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputPoolResource]: - """Updates the properties of an existing Azure Cosmos DB Throughput Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param body: The parameters to provide for the current Throughput Pool. Is either a - ThroughputPoolUpdate type or a IO[bytes] type. Default value is None. - :type body: ~azure.mgmt.cosmosdb.models.ThroughputPoolUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ThroughputPoolResource or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :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.ThroughputPoolResource] = 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, - throughput_pool_name=throughput_pool_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputPoolResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, 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.ThroughputPoolResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ThroughputPoolResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, throughput_pool_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - 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["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - 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, throughput_pool_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an existing Azure Cosmos DB Throughput Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._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( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pools_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pools_operations.py deleted file mode 100644 index f48b17d2bf1f..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pools_operations.py +++ /dev/null @@ -1,215 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._throughput_pools_operations import build_list_by_resource_group_request, build_list_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ThroughputPoolsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.aio.CosmosDBManagementClient`'s - :attr:`throughput_pools` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.ThroughputPoolResource"]: - """Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - - :return: An iterator like instance of either ThroughputPoolResource or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :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.ThroughputPoolsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ThroughputPoolsListResult", 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.ThroughputPoolResource"]: - """List all the ThroughputPools in a given 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 ThroughputPoolResource or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :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.ThroughputPoolsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ThroughputPoolsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py index 9458f8878acd..82c5dc2745f0 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py @@ -16,9 +16,6 @@ from ._models_py3 import ( # type: ignore ARMProxyResource, ARMResourceProperties, - AccessRule, - AccessRuleProperties, - AccessRulePropertiesSubscriptionsItem, AccountKeyMetadata, AnalyticalStorageConfiguration, ApiProperties, @@ -26,16 +23,11 @@ AutoUpgradePolicyResource, AutoscaleSettings, AutoscaleSettingsResource, - AzureBlobDataTransferDataSourceSink, BackupInformation, BackupPolicy, BackupPolicyMigrationState, - BackupResource, - BackupSchedule, - BaseCosmosDataTransferDataSourceSink, Capability, Capacity, - CapacityModeChangeTransitionState, CassandraClusterDataCenterNodeItem, CassandraClusterPublicStatus, CassandraClusterPublicStatusDataCentersItem, @@ -54,15 +46,7 @@ CassandraTableGetResults, CassandraTableListResult, CassandraTableResource, - CassandraViewCreateUpdateParameters, - CassandraViewGetPropertiesOptions, - CassandraViewGetPropertiesResource, - CassandraViewGetResults, - CassandraViewListResult, - CassandraViewResource, Certificate, - ChaosFaultListResponse, - ChaosFaultResource, ClientEncryptionIncludedPath, ClientEncryptionKeyCreateUpdateParameters, ClientEncryptionKeyGetPropertiesResource, @@ -74,10 +58,8 @@ ClusterResource, ClusterResourceProperties, Column, - CommandAsyncPostBody, CommandOutput, CommandPostBody, - CommandPublicResource, CompositePath, ComputedProperty, ConflictResolutionPolicy, @@ -89,18 +71,9 @@ ContinuousModeBackupPolicy, ContinuousModeProperties, CorsPolicy, - CosmosCassandraDataTransferDataSourceSink, - CosmosMongoDataTransferDataSourceSink, - CosmosMongoVCoreDataTransferDataSourceSink, - CosmosSqlDataTransferDataSourceSink, - CreateJobRequest, CreateUpdateOptions, DataCenterResource, DataCenterResourceProperties, - DataTransferDataSourceSink, - DataTransferJobFeedResults, - DataTransferJobGetResults, - DataTransferJobProperties, DataTransferRegionalServiceResource, DataTransferServiceResource, DataTransferServiceResourceCreateUpdateProperties, @@ -116,7 +89,6 @@ DatabaseAccountUpdateParameters, DatabaseAccountsListResult, DatabaseRestoreResource, - DiagnosticLogSettings, ErrorAdditionalInfo, ErrorDetail, ErrorResponse, @@ -125,16 +97,12 @@ ExtendedResourceProperties, FailoverPolicies, FailoverPolicy, + FullTextPath, + FullTextPolicy, GraphAPIComputeRegionalServiceResource, GraphAPIComputeServiceResource, GraphAPIComputeServiceResourceCreateUpdateProperties, GraphAPIComputeServiceResourceProperties, - GraphResource, - GraphResourceCreateUpdateParameters, - GraphResourceGetPropertiesOptions, - GraphResourceGetPropertiesResource, - GraphResourceGetResults, - GraphResourcesListResult, GremlinDatabaseCreateUpdateParameters, GremlinDatabaseGetPropertiesOptions, GremlinDatabaseGetPropertiesResource, @@ -153,9 +121,7 @@ IndexingPolicy, IpAddressOrRange, KeyWrapMetadata, - ListBackups, ListClusters, - ListCommands, ListDataCenters, Location, LocationGetResult, @@ -166,12 +132,10 @@ ManagedCassandraReaperStatus, ManagedServiceIdentity, ManagedServiceIdentityUserAssignedIdentity, - MaterializedViewDefinition, MaterializedViewsBuilderRegionalServiceResource, MaterializedViewsBuilderServiceResource, MaterializedViewsBuilderServiceResourceCreateUpdateProperties, MaterializedViewsBuilderServiceResourceProperties, - MergeParameters, Metric, MetricAvailability, MetricDefinition, @@ -200,11 +164,6 @@ MongoUserDefinitionCreateUpdateParameters, MongoUserDefinitionGetResults, MongoUserDefinitionListResult, - NetworkSecurityPerimeter, - NetworkSecurityPerimeterConfiguration, - NetworkSecurityPerimeterConfigurationListResult, - NetworkSecurityPerimeterConfigurationProperties, - NetworkSecurityProfile, NotebookWorkspace, NotebookWorkspaceConnectionInfoResult, NotebookWorkspaceCreateUpdateParameters, @@ -223,14 +182,6 @@ PeriodicModeBackupPolicy, PeriodicModeProperties, Permission, - PermissionAutoGenerated, - PhysicalPartitionId, - PhysicalPartitionStorageInfo, - PhysicalPartitionStorageInfoCollection, - PhysicalPartitionThroughputInfoProperties, - PhysicalPartitionThroughputInfoResource, - PhysicalPartitionThroughputInfoResult, - PhysicalPartitionThroughputInfoResultPropertiesResource, PrivateEndpointConnection, PrivateEndpointConnectionListResult, PrivateEndpointProperty, @@ -239,15 +190,10 @@ PrivateLinkServiceConnectionStateProperty, Privilege, PrivilegeResource, - ProvisioningIssue, - ProvisioningIssueProperties, ProxyResource, - RedistributeThroughputParameters, - RedistributeThroughputPropertiesResource, RegionForOnlineOffline, RegionalServiceResource, Resource, - ResourceAssociation, ResourceRestoreParameters, RestorableDatabaseAccountGetResult, RestorableDatabaseAccountsListResult, @@ -285,8 +231,6 @@ RestorableTablesListResult, RestoreParameters, RestoreParametersBase, - RetrieveThroughputParameters, - RetrieveThroughputPropertiesResource, Role, SeedNode, ServiceResource, @@ -339,23 +283,11 @@ TableGetResults, TableListResult, TableResource, - TableRoleAssignmentListResult, - TableRoleAssignmentResource, - TableRoleDefinitionListResult, - TableRoleDefinitionResource, - ThroughputBucketResource, ThroughputPolicyResource, - ThroughputPoolAccountCreateParameters, - ThroughputPoolAccountResource, - ThroughputPoolAccountsListResult, - ThroughputPoolResource, - ThroughputPoolUpdate, - ThroughputPoolsListResult, ThroughputSettingsGetPropertiesResource, ThroughputSettingsGetResults, ThroughputSettingsResource, ThroughputSettingsUpdateParameters, - TrackedResource, UniqueKey, UniqueKeyPolicy, Usage, @@ -367,20 +299,13 @@ ) from ._cosmos_db_management_client_enums import ( # type: ignore - AccessRuleDirection, AnalyticalStorageSchemaType, ApiType, AuthenticationMethod, - AutoReplicate, AzureConnectionType, BackupPolicyMigrationStatus, BackupPolicyType, - BackupState, BackupStorageRedundancy, - CapacityMode, - CapacityModeTransitionStatus, - ClusterType, - CommandStatus, CompositePathSortOrder, ConflictResolutionMode, ConnectionState, @@ -388,18 +313,13 @@ ContinuousTier, CreateMode, CreatedByType, - DataTransferComponent, - DataTransferJobMode, DataType, DatabaseAccountKind, DedicatedGatewayType, DefaultConsistencyLevel, - DefaultPriorityLevel, DistanceFunction, - EnableFullTextQuery, IndexKind, IndexingMode, - IssueType, KeyKind, Kind, ManagedCassandraProvisioningState, @@ -407,7 +327,6 @@ MinimalTlsVersion, MongoRoleDefinitionType, NetworkAclBypass, - NetworkSecurityPerimeterConfigurationProvisioningState, NodeState, NodeStatus, NotebookWorkspaceName, @@ -415,20 +334,15 @@ PartitionKind, PrimaryAggregationType, PublicNetworkAccess, - ResourceAssociationAccessMode, ResourceIdentityType, RestoreMode, RoleDefinitionType, - ScheduledEventStrategy, ServerVersion, ServiceSize, ServiceStatus, ServiceType, - Severity, SpatialType, Status, - SupportedActions, - ThroughputPolicyType, TriggerOperation, TriggerType, Type, @@ -443,9 +357,6 @@ __all__ = [ "ARMProxyResource", "ARMResourceProperties", - "AccessRule", - "AccessRuleProperties", - "AccessRulePropertiesSubscriptionsItem", "AccountKeyMetadata", "AnalyticalStorageConfiguration", "ApiProperties", @@ -453,16 +364,11 @@ "AutoUpgradePolicyResource", "AutoscaleSettings", "AutoscaleSettingsResource", - "AzureBlobDataTransferDataSourceSink", "BackupInformation", "BackupPolicy", "BackupPolicyMigrationState", - "BackupResource", - "BackupSchedule", - "BaseCosmosDataTransferDataSourceSink", "Capability", "Capacity", - "CapacityModeChangeTransitionState", "CassandraClusterDataCenterNodeItem", "CassandraClusterPublicStatus", "CassandraClusterPublicStatusDataCentersItem", @@ -481,15 +387,7 @@ "CassandraTableGetResults", "CassandraTableListResult", "CassandraTableResource", - "CassandraViewCreateUpdateParameters", - "CassandraViewGetPropertiesOptions", - "CassandraViewGetPropertiesResource", - "CassandraViewGetResults", - "CassandraViewListResult", - "CassandraViewResource", "Certificate", - "ChaosFaultListResponse", - "ChaosFaultResource", "ClientEncryptionIncludedPath", "ClientEncryptionKeyCreateUpdateParameters", "ClientEncryptionKeyGetPropertiesResource", @@ -501,10 +399,8 @@ "ClusterResource", "ClusterResourceProperties", "Column", - "CommandAsyncPostBody", "CommandOutput", "CommandPostBody", - "CommandPublicResource", "CompositePath", "ComputedProperty", "ConflictResolutionPolicy", @@ -516,18 +412,9 @@ "ContinuousModeBackupPolicy", "ContinuousModeProperties", "CorsPolicy", - "CosmosCassandraDataTransferDataSourceSink", - "CosmosMongoDataTransferDataSourceSink", - "CosmosMongoVCoreDataTransferDataSourceSink", - "CosmosSqlDataTransferDataSourceSink", - "CreateJobRequest", "CreateUpdateOptions", "DataCenterResource", "DataCenterResourceProperties", - "DataTransferDataSourceSink", - "DataTransferJobFeedResults", - "DataTransferJobGetResults", - "DataTransferJobProperties", "DataTransferRegionalServiceResource", "DataTransferServiceResource", "DataTransferServiceResourceCreateUpdateProperties", @@ -543,7 +430,6 @@ "DatabaseAccountUpdateParameters", "DatabaseAccountsListResult", "DatabaseRestoreResource", - "DiagnosticLogSettings", "ErrorAdditionalInfo", "ErrorDetail", "ErrorResponse", @@ -552,16 +438,12 @@ "ExtendedResourceProperties", "FailoverPolicies", "FailoverPolicy", + "FullTextPath", + "FullTextPolicy", "GraphAPIComputeRegionalServiceResource", "GraphAPIComputeServiceResource", "GraphAPIComputeServiceResourceCreateUpdateProperties", "GraphAPIComputeServiceResourceProperties", - "GraphResource", - "GraphResourceCreateUpdateParameters", - "GraphResourceGetPropertiesOptions", - "GraphResourceGetPropertiesResource", - "GraphResourceGetResults", - "GraphResourcesListResult", "GremlinDatabaseCreateUpdateParameters", "GremlinDatabaseGetPropertiesOptions", "GremlinDatabaseGetPropertiesResource", @@ -580,9 +462,7 @@ "IndexingPolicy", "IpAddressOrRange", "KeyWrapMetadata", - "ListBackups", "ListClusters", - "ListCommands", "ListDataCenters", "Location", "LocationGetResult", @@ -593,12 +473,10 @@ "ManagedCassandraReaperStatus", "ManagedServiceIdentity", "ManagedServiceIdentityUserAssignedIdentity", - "MaterializedViewDefinition", "MaterializedViewsBuilderRegionalServiceResource", "MaterializedViewsBuilderServiceResource", "MaterializedViewsBuilderServiceResourceCreateUpdateProperties", "MaterializedViewsBuilderServiceResourceProperties", - "MergeParameters", "Metric", "MetricAvailability", "MetricDefinition", @@ -627,11 +505,6 @@ "MongoUserDefinitionCreateUpdateParameters", "MongoUserDefinitionGetResults", "MongoUserDefinitionListResult", - "NetworkSecurityPerimeter", - "NetworkSecurityPerimeterConfiguration", - "NetworkSecurityPerimeterConfigurationListResult", - "NetworkSecurityPerimeterConfigurationProperties", - "NetworkSecurityProfile", "NotebookWorkspace", "NotebookWorkspaceConnectionInfoResult", "NotebookWorkspaceCreateUpdateParameters", @@ -650,14 +523,6 @@ "PeriodicModeBackupPolicy", "PeriodicModeProperties", "Permission", - "PermissionAutoGenerated", - "PhysicalPartitionId", - "PhysicalPartitionStorageInfo", - "PhysicalPartitionStorageInfoCollection", - "PhysicalPartitionThroughputInfoProperties", - "PhysicalPartitionThroughputInfoResource", - "PhysicalPartitionThroughputInfoResult", - "PhysicalPartitionThroughputInfoResultPropertiesResource", "PrivateEndpointConnection", "PrivateEndpointConnectionListResult", "PrivateEndpointProperty", @@ -666,15 +531,10 @@ "PrivateLinkServiceConnectionStateProperty", "Privilege", "PrivilegeResource", - "ProvisioningIssue", - "ProvisioningIssueProperties", "ProxyResource", - "RedistributeThroughputParameters", - "RedistributeThroughputPropertiesResource", "RegionForOnlineOffline", "RegionalServiceResource", "Resource", - "ResourceAssociation", "ResourceRestoreParameters", "RestorableDatabaseAccountGetResult", "RestorableDatabaseAccountsListResult", @@ -712,8 +572,6 @@ "RestorableTablesListResult", "RestoreParameters", "RestoreParametersBase", - "RetrieveThroughputParameters", - "RetrieveThroughputPropertiesResource", "Role", "SeedNode", "ServiceResource", @@ -766,23 +624,11 @@ "TableGetResults", "TableListResult", "TableResource", - "TableRoleAssignmentListResult", - "TableRoleAssignmentResource", - "TableRoleDefinitionListResult", - "TableRoleDefinitionResource", - "ThroughputBucketResource", "ThroughputPolicyResource", - "ThroughputPoolAccountCreateParameters", - "ThroughputPoolAccountResource", - "ThroughputPoolAccountsListResult", - "ThroughputPoolResource", - "ThroughputPoolUpdate", - "ThroughputPoolsListResult", "ThroughputSettingsGetPropertiesResource", "ThroughputSettingsGetResults", "ThroughputSettingsResource", "ThroughputSettingsUpdateParameters", - "TrackedResource", "UniqueKey", "UniqueKeyPolicy", "Usage", @@ -791,20 +637,13 @@ "VectorEmbeddingPolicy", "VectorIndex", "VirtualNetworkRule", - "AccessRuleDirection", "AnalyticalStorageSchemaType", "ApiType", "AuthenticationMethod", - "AutoReplicate", "AzureConnectionType", "BackupPolicyMigrationStatus", "BackupPolicyType", - "BackupState", "BackupStorageRedundancy", - "CapacityMode", - "CapacityModeTransitionStatus", - "ClusterType", - "CommandStatus", "CompositePathSortOrder", "ConflictResolutionMode", "ConnectionState", @@ -812,18 +651,13 @@ "ContinuousTier", "CreateMode", "CreatedByType", - "DataTransferComponent", - "DataTransferJobMode", "DataType", "DatabaseAccountKind", "DedicatedGatewayType", "DefaultConsistencyLevel", - "DefaultPriorityLevel", "DistanceFunction", - "EnableFullTextQuery", "IndexKind", "IndexingMode", - "IssueType", "KeyKind", "Kind", "ManagedCassandraProvisioningState", @@ -831,7 +665,6 @@ "MinimalTlsVersion", "MongoRoleDefinitionType", "NetworkAclBypass", - "NetworkSecurityPerimeterConfigurationProvisioningState", "NodeState", "NodeStatus", "NotebookWorkspaceName", @@ -839,20 +672,15 @@ "PartitionKind", "PrimaryAggregationType", "PublicNetworkAccess", - "ResourceAssociationAccessMode", "ResourceIdentityType", "RestoreMode", "RoleDefinitionType", - "ScheduledEventStrategy", "ServerVersion", "ServiceSize", "ServiceStatus", "ServiceType", - "Severity", "SpatialType", "Status", - "SupportedActions", - "ThroughputPolicyType", "TriggerOperation", "TriggerType", "Type", diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_cosmos_db_management_client_enums.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_cosmos_db_management_client_enums.py index 6ff671c725ba..6e70c1ff4084 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_cosmos_db_management_client_enums.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_cosmos_db_management_client_enums.py @@ -10,15 +10,6 @@ from azure.core import CaseInsensitiveEnumMeta -class AccessRuleDirection(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Direction of Access Rule.""" - - INBOUND = "Inbound" - """Applies to inbound network traffic to the secured resources.""" - OUTBOUND = "Outbound" - """Applies to outbound network traffic from the secured resources""" - - class AnalyticalStorageSchemaType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Describes the types of schema for analytical storage.""" @@ -48,14 +39,6 @@ class AuthenticationMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): LDAP = "Ldap" -class AutoReplicate(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The form of AutoReplicate that is being used by this cluster.""" - - NONE = "None" - SYSTEM_KEYSPACES = "SystemKeyspaces" - ALL_KEYSPACES = "AllKeyspaces" - - class AzureConnectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """How to connect to the azure services needed for running the cluster.""" @@ -79,15 +62,6 @@ class BackupPolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): CONTINUOUS = "Continuous" -class BackupState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current state of the backup.""" - - INITIATED = "Initiated" - IN_PROGRESS = "InProgress" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - - class BackupStorageRedundancy(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Enum to indicate type of backup storage redundancy.""" @@ -96,42 +70,6 @@ class BackupStorageRedundancy(str, Enum, metaclass=CaseInsensitiveEnumMeta): ZONE = "Zone" -class CapacityMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates the capacity mode of the account.""" - - NONE = "None" - PROVISIONED = "Provisioned" - SERVERLESS = "Serverless" - - -class CapacityModeTransitionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The transition status of capacity mode.""" - - INVALID = "Invalid" - INITIALIZED = "Initialized" - IN_PROGRESS = "InProgress" - COMPLETED = "Completed" - FAILED = "Failed" - - -class ClusterType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the cluster. If set to Production, some operations might not be permitted on cluster.""" - - PRODUCTION = "Production" - NON_PRODUCTION = "NonProduction" - - -class CommandStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of the command.""" - - DONE = "Done" - RUNNING = "Running" - ENQUEUE = "Enqueue" - PROCESSING = "Processing" - FINISHED = "Finished" - FAILED = "Failed" - - class CompositePathSortOrder(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Sort order for composite paths.""" @@ -194,23 +132,6 @@ class DatabaseAccountKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): PARSE = "Parse" -class DataTransferComponent(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """DataTransferComponent.""" - - COSMOS_DB_CASSANDRA = "CosmosDBCassandra" - COSMOS_DB_MONGO = "CosmosDBMongo" - COSMOS_DB_MONGO_V_CORE = "CosmosDBMongoVCore" - COSMOS_DB_SQL = "CosmosDBSql" - AZURE_BLOB_STORAGE = "AzureBlobStorage" - - -class DataTransferJobMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mode of job execution.""" - - OFFLINE = "Offline" - ONLINE = "Online" - - class DataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The datatype for which the indexing behavior is applied to.""" @@ -239,13 +160,6 @@ class DefaultConsistencyLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): CONSISTENT_PREFIX = "ConsistentPrefix" -class DefaultPriorityLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to indicate default priorityLevel of requests.""" - - HIGH = "High" - LOW = "Low" - - class DistanceFunction(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The distance function to use for distance calculation in between vectors.""" @@ -254,14 +168,6 @@ class DistanceFunction(str, Enum, metaclass=CaseInsensitiveEnumMeta): DOTPRODUCT = "dotproduct" -class EnableFullTextQuery(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Describe the level of detail with which queries are to be logged.""" - - NONE = "None" - TRUE = "True" - FALSE = "False" - - class IndexingMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Indicates the indexing mode.""" @@ -278,22 +184,6 @@ class IndexKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): SPATIAL = "Spatial" -class IssueType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of issue.""" - - UNKNOWN = "Unknown" - """Unknown issue type""" - CONFIGURATION_PROPAGATION_FAILURE = "ConfigurationPropagationFailure" - """An error occurred while applying the network security perimeter (NSP) configuration.""" - MISSING_PERIMETER_CONFIGURATION = "MissingPerimeterConfiguration" - """A network connectivity issue is happening on the resource which could be addressed either by - adding new resources to the network security perimeter (NSP) or by modifying access rules.""" - MISSING_IDENTITY_CONFIGURATION = "MissingIdentityConfiguration" - """An managed identity hasn't been associated with the resource. The resource will still be able - to validate inbound traffic from the network security perimeter (NSP) or matching inbound - access rules, but it won't be able to perform outbound access as a member of the NSP.""" - - class KeyKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The access key to regenerate.""" @@ -331,8 +221,8 @@ class ManagedCassandraResourceIdentityType(str, Enum, metaclass=CaseInsensitiveE class MinimalTlsVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and - Mongo API's, which only work with Tls 1.2. + """Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo + APIs only work with Tls 1.2. """ TLS = "Tls" @@ -354,20 +244,6 @@ class NetworkAclBypass(str, Enum, metaclass=CaseInsensitiveEnumMeta): AZURE_SERVICES = "AzureServices" -class NetworkSecurityPerimeterConfigurationProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Provisioning state of a network security perimeter configuration that is being created or - updated. - """ - - SUCCEEDED = "Succeeded" - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - ACCEPTED = "Accepted" - FAILED = "Failed" - CANCELED = "Canceled" - - class NodeState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The state of the node in Cassandra ring.""" @@ -430,17 +306,6 @@ class PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): SECURED_BY_PERIMETER = "SecuredByPerimeter" -class ResourceAssociationAccessMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Access mode of the resource association.""" - - ENFORCED = "Enforced" - """Enforced access mode - traffic to the resource that failed access checks is blocked""" - LEARNING = "Learning" - """Learning access mode - traffic to the resource is enabled for analysis but not blocked""" - AUDIT = "Audit" - """Audit access mode - traffic to the resource that fails access checks is logged but not blocked""" - - class ResourceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will @@ -466,14 +331,6 @@ class RoleDefinitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): CUSTOM_ROLE = "CustomRole" -class ScheduledEventStrategy(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """How the nodes in the cluster react to scheduled events.""" - - IGNORE = "Ignore" - STOP_ANY = "StopAny" - STOP_BY_RACK = "StopByRack" - - class ServerVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Describes the version of the MongoDB account.""" @@ -514,13 +371,6 @@ class ServiceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): MATERIALIZED_VIEWS_BUILDER = "MaterializedViewsBuilder" -class Severity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Severity of the issue.""" - - WARNING = "Warning" - ERROR = "Error" - - class SpatialType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Indicates the spatial type of index.""" @@ -538,25 +388,6 @@ class Status(str, Enum, metaclass=CaseInsensitiveEnumMeta): INTERNALLY_READY = "InternallyReady" ONLINE = "Online" DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - UPDATING = "Updating" - - -class SupportedActions(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates whether what action to take for the Chaos Fault.""" - - ENABLE = "Enable" - DISABLE = "Disable" - - -class ThroughputPolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """ThroughputPolicy to apply for throughput redistribution.""" - - NONE = "none" - EQUAL = "equal" - CUSTOM = "custom" class TriggerOperation(str, Enum, metaclass=CaseInsensitiveEnumMeta): diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models_py3.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models_py3.py index 5cd554b3e43d..4682b736847d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models_py3.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models_py3.py @@ -8,139 +8,12 @@ # -------------------------------------------------------------------------- import datetime -import sys from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union from .. import _serialization -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore - if TYPE_CHECKING: from .. import models as _models -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object - - -class AccessRule(_serialization.Model): - """Access rule in a network security perimeter configuration profile. - - :ivar name: Name of the access rule. - :vartype name: str - :ivar properties: Properties of Access Rule. - :vartype properties: ~azure.mgmt.cosmosdb.models.AccessRuleProperties - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "properties": {"key": "properties", "type": "AccessRuleProperties"}, - } - - def __init__( - self, *, name: Optional[str] = None, properties: Optional["_models.AccessRuleProperties"] = None, **kwargs: Any - ) -> None: - """ - :keyword name: Name of the access rule. - :paramtype name: str - :keyword properties: Properties of Access Rule. - :paramtype properties: ~azure.mgmt.cosmosdb.models.AccessRuleProperties - """ - super().__init__(**kwargs) - self.name = name - self.properties = properties - - -class AccessRuleProperties(_serialization.Model): - """Properties of Access Rule. - - :ivar direction: Direction of Access Rule. Known values are: "Inbound" and "Outbound". - :vartype direction: str or ~azure.mgmt.cosmosdb.models.AccessRuleDirection - :ivar address_prefixes: Address prefixes in the CIDR format for inbound rules. - :vartype address_prefixes: list[str] - :ivar subscriptions: Subscriptions for inbound rules. - :vartype subscriptions: list[~azure.mgmt.cosmosdb.models.AccessRulePropertiesSubscriptionsItem] - :ivar network_security_perimeters: Network security perimeters for inbound rules. - :vartype network_security_perimeters: - list[~azure.mgmt.cosmosdb.models.NetworkSecurityPerimeter] - :ivar fully_qualified_domain_names: Fully qualified domain names (FQDN) for outbound rules. - :vartype fully_qualified_domain_names: list[str] - :ivar email_addresses: Email addresses for outbound rules. - :vartype email_addresses: list[str] - :ivar phone_numbers: Phone numbers for outbound rules. - :vartype phone_numbers: list[str] - """ - - _attribute_map = { - "direction": {"key": "direction", "type": "str"}, - "address_prefixes": {"key": "addressPrefixes", "type": "[str]"}, - "subscriptions": {"key": "subscriptions", "type": "[AccessRulePropertiesSubscriptionsItem]"}, - "network_security_perimeters": {"key": "networkSecurityPerimeters", "type": "[NetworkSecurityPerimeter]"}, - "fully_qualified_domain_names": {"key": "fullyQualifiedDomainNames", "type": "[str]"}, - "email_addresses": {"key": "emailAddresses", "type": "[str]"}, - "phone_numbers": {"key": "phoneNumbers", "type": "[str]"}, - } - - def __init__( - self, - *, - direction: Optional[Union[str, "_models.AccessRuleDirection"]] = None, - address_prefixes: Optional[List[str]] = None, - subscriptions: Optional[List["_models.AccessRulePropertiesSubscriptionsItem"]] = None, - network_security_perimeters: Optional[List["_models.NetworkSecurityPerimeter"]] = None, - fully_qualified_domain_names: Optional[List[str]] = None, - email_addresses: Optional[List[str]] = None, - phone_numbers: Optional[List[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword direction: Direction of Access Rule. Known values are: "Inbound" and "Outbound". - :paramtype direction: str or ~azure.mgmt.cosmosdb.models.AccessRuleDirection - :keyword address_prefixes: Address prefixes in the CIDR format for inbound rules. - :paramtype address_prefixes: list[str] - :keyword subscriptions: Subscriptions for inbound rules. - :paramtype subscriptions: - list[~azure.mgmt.cosmosdb.models.AccessRulePropertiesSubscriptionsItem] - :keyword network_security_perimeters: Network security perimeters for inbound rules. - :paramtype network_security_perimeters: - list[~azure.mgmt.cosmosdb.models.NetworkSecurityPerimeter] - :keyword fully_qualified_domain_names: Fully qualified domain names (FQDN) for outbound rules. - :paramtype fully_qualified_domain_names: list[str] - :keyword email_addresses: Email addresses for outbound rules. - :paramtype email_addresses: list[str] - :keyword phone_numbers: Phone numbers for outbound rules. - :paramtype phone_numbers: list[str] - """ - super().__init__(**kwargs) - self.direction = direction - self.address_prefixes = address_prefixes - self.subscriptions = subscriptions - self.network_security_perimeters = network_security_perimeters - self.fully_qualified_domain_names = fully_qualified_domain_names - self.email_addresses = email_addresses - self.phone_numbers = phone_numbers - - -class AccessRulePropertiesSubscriptionsItem(_serialization.Model): - """Subscription identifiers. - - :ivar id: The fully qualified Azure resource ID of the subscription e.g. - ('/subscriptions/00000000-0000-0000-0000-000000000000'). - :vartype id: str - """ - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - } - - def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin - """ - :keyword id: The fully qualified Azure resource ID of the subscription e.g. - ('/subscriptions/00000000-0000-0000-0000-000000000000'). - :paramtype id: str - """ - super().__init__(**kwargs) - self.id = id class AccountKeyMetadata(_serialization.Model): @@ -268,8 +141,6 @@ class ARMResourceProperties(_serialization.Model): with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity """ _validation = { @@ -284,17 +155,9 @@ class ARMResourceProperties(_serialization.Model): "type": {"key": "type", "type": "str"}, "location": {"key": "location", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, } - def __init__( - self, - *, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -305,8 +168,6 @@ def __init__( with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity """ super().__init__(**kwargs) self.id = None @@ -314,7 +175,6 @@ def __init__( self.type = None self.location = location self.tags = tags - self.identity = identity class AuthenticationMethodLdapProperties(_serialization.Model): @@ -489,80 +349,6 @@ def __init__( self.throughput_policy = throughput_policy -class DataTransferDataSourceSink(_serialization.Model): - """Base class for all DataTransfer source/sink. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AzureBlobDataTransferDataSourceSink, BaseCosmosDataTransferDataSourceSink, - CosmosMongoVCoreDataTransferDataSourceSink - - All required parameters must be populated in order to send to server. - - :ivar component: Known values are: "CosmosDBCassandra", "CosmosDBMongo", "CosmosDBMongoVCore", - "CosmosDBSql", and "AzureBlobStorage". - :vartype component: str or ~azure.mgmt.cosmosdb.models.DataTransferComponent - """ - - _validation = { - "component": {"required": True}, - } - - _attribute_map = { - "component": {"key": "component", "type": "str"}, - } - - _subtype_map = { - "component": { - "AzureBlobStorage": "AzureBlobDataTransferDataSourceSink", - "BaseCosmosDataTransferDataSourceSink": "BaseCosmosDataTransferDataSourceSink", - "CosmosDBMongoVCore": "CosmosMongoVCoreDataTransferDataSourceSink", - } - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.component: Optional[str] = None - - -class AzureBlobDataTransferDataSourceSink(DataTransferDataSourceSink): - """An Azure Blob Storage data source/sink. - - All required parameters must be populated in order to send to server. - - :ivar component: Known values are: "CosmosDBCassandra", "CosmosDBMongo", "CosmosDBMongoVCore", - "CosmosDBSql", and "AzureBlobStorage". - :vartype component: str or ~azure.mgmt.cosmosdb.models.DataTransferComponent - :ivar container_name: Required. - :vartype container_name: str - :ivar endpoint_url: - :vartype endpoint_url: str - """ - - _validation = { - "component": {"required": True}, - "container_name": {"required": True}, - } - - _attribute_map = { - "component": {"key": "component", "type": "str"}, - "container_name": {"key": "containerName", "type": "str"}, - "endpoint_url": {"key": "endpointUrl", "type": "str"}, - } - - def __init__(self, *, container_name: str, endpoint_url: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword container_name: Required. - :paramtype container_name: str - :keyword endpoint_url: - :paramtype endpoint_url: str - """ - super().__init__(**kwargs) - self.component: str = "AzureBlobStorage" - self.container_name = container_name - self.endpoint_url = endpoint_url - - class BackupInformation(_serialization.Model): """Backup information of a resource. @@ -669,145 +455,6 @@ def __init__( self.start_time = start_time -class BackupResource(_serialization.Model): - """A restorable backup of a Cassandra cluster. - - :ivar backup_id: The unique identifier of backup. - :vartype backup_id: str - :ivar backup_state: The current state of the backup. Known values are: "Initiated", - "InProgress", "Succeeded", and "Failed". - :vartype backup_state: str or ~azure.mgmt.cosmosdb.models.BackupState - :ivar backup_start_timestamp: The time at which the backup process begins. - :vartype backup_start_timestamp: ~datetime.datetime - :ivar backup_stop_timestamp: The time at which the backup process ends. - :vartype backup_stop_timestamp: ~datetime.datetime - :ivar backup_expiry_timestamp: The time at which the backup will expire. - :vartype backup_expiry_timestamp: ~datetime.datetime - """ - - _attribute_map = { - "backup_id": {"key": "backupId", "type": "str"}, - "backup_state": {"key": "backupState", "type": "str"}, - "backup_start_timestamp": {"key": "backupStartTimestamp", "type": "iso-8601"}, - "backup_stop_timestamp": {"key": "backupStopTimestamp", "type": "iso-8601"}, - "backup_expiry_timestamp": {"key": "backupExpiryTimestamp", "type": "iso-8601"}, - } - - def __init__( - self, - *, - backup_id: Optional[str] = None, - backup_state: Optional[Union[str, "_models.BackupState"]] = None, - backup_start_timestamp: Optional[datetime.datetime] = None, - backup_stop_timestamp: Optional[datetime.datetime] = None, - backup_expiry_timestamp: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: - """ - :keyword backup_id: The unique identifier of backup. - :paramtype backup_id: str - :keyword backup_state: The current state of the backup. Known values are: "Initiated", - "InProgress", "Succeeded", and "Failed". - :paramtype backup_state: str or ~azure.mgmt.cosmosdb.models.BackupState - :keyword backup_start_timestamp: The time at which the backup process begins. - :paramtype backup_start_timestamp: ~datetime.datetime - :keyword backup_stop_timestamp: The time at which the backup process ends. - :paramtype backup_stop_timestamp: ~datetime.datetime - :keyword backup_expiry_timestamp: The time at which the backup will expire. - :paramtype backup_expiry_timestamp: ~datetime.datetime - """ - super().__init__(**kwargs) - self.backup_id = backup_id - self.backup_state = backup_state - self.backup_start_timestamp = backup_start_timestamp - self.backup_stop_timestamp = backup_stop_timestamp - self.backup_expiry_timestamp = backup_expiry_timestamp - - -class BackupSchedule(_serialization.Model): - """BackupSchedule. - - :ivar schedule_name: The unique identifier of backup schedule. - :vartype schedule_name: str - :ivar cron_expression: The cron expression that defines when you want to back up your data. - :vartype cron_expression: str - :ivar retention_in_hours: The retention period (hours) of the backups. If you want to retain - data forever, set retention to 0. - :vartype retention_in_hours: int - """ - - _attribute_map = { - "schedule_name": {"key": "scheduleName", "type": "str"}, - "cron_expression": {"key": "cronExpression", "type": "str"}, - "retention_in_hours": {"key": "retentionInHours", "type": "int"}, - } - - def __init__( - self, - *, - schedule_name: Optional[str] = None, - cron_expression: Optional[str] = None, - retention_in_hours: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword schedule_name: The unique identifier of backup schedule. - :paramtype schedule_name: str - :keyword cron_expression: The cron expression that defines when you want to back up your data. - :paramtype cron_expression: str - :keyword retention_in_hours: The retention period (hours) of the backups. If you want to retain - data forever, set retention to 0. - :paramtype retention_in_hours: int - """ - super().__init__(**kwargs) - self.schedule_name = schedule_name - self.cron_expression = cron_expression - self.retention_in_hours = retention_in_hours - - -class BaseCosmosDataTransferDataSourceSink(DataTransferDataSourceSink): - """A base CosmosDB data source/sink. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - CosmosCassandraDataTransferDataSourceSink, CosmosMongoDataTransferDataSourceSink, - CosmosSqlDataTransferDataSourceSink - - All required parameters must be populated in order to send to server. - - :ivar component: Known values are: "CosmosDBCassandra", "CosmosDBMongo", "CosmosDBMongoVCore", - "CosmosDBSql", and "AzureBlobStorage". - :vartype component: str or ~azure.mgmt.cosmosdb.models.DataTransferComponent - :ivar remote_account_name: - :vartype remote_account_name: str - """ - - _validation = { - "component": {"required": True}, - } - - _attribute_map = { - "component": {"key": "component", "type": "str"}, - "remote_account_name": {"key": "remoteAccountName", "type": "str"}, - } - - _subtype_map = { - "component": { - "CosmosDBCassandra": "CosmosCassandraDataTransferDataSourceSink", - "CosmosDBMongo": "CosmosMongoDataTransferDataSourceSink", - "CosmosDBSql": "CosmosSqlDataTransferDataSourceSink", - } - } - - def __init__(self, *, remote_account_name: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword remote_account_name: - :paramtype remote_account_name: str - """ - super().__init__(**kwargs) - self.component: str = "BaseCosmosDataTransferDataSourceSink" - self.remote_account_name = remote_account_name - - class Capability(_serialization.Model): """Cosmos DB capability object. @@ -860,77 +507,6 @@ def __init__(self, *, total_throughput_limit: Optional[int] = None, **kwargs: An self.total_throughput_limit = total_throughput_limit -class CapacityModeChangeTransitionState(_serialization.Model): - """The transition state information related capacity mode change with update request. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar capacity_mode_transition_status: The transition status of capacity mode. Known values - are: "Invalid", "Initialized", "InProgress", "Completed", and "Failed". - :vartype capacity_mode_transition_status: str or - ~azure.mgmt.cosmosdb.models.CapacityModeTransitionStatus - :ivar current_capacity_mode: Indicates the current capacity mode of the account. Known values - are: "None", "Provisioned", and "Serverless". - :vartype current_capacity_mode: str or ~azure.mgmt.cosmosdb.models.CapacityMode - :ivar previous_capacity_mode: Indicates the previous capacity mode of the account before - successful transition. Known values are: "None", "Provisioned", and "Serverless". - :vartype previous_capacity_mode: str or ~azure.mgmt.cosmosdb.models.CapacityMode - :ivar capacity_mode_transition_begin_timestamp: Begin time in UTC of the capacity mode change. - :vartype capacity_mode_transition_begin_timestamp: ~datetime.datetime - :ivar capacity_mode_transition_end_timestamp: End time in UTC of the capacity mode change. - :vartype capacity_mode_transition_end_timestamp: ~datetime.datetime - :ivar capacity_mode_last_successful_transition_end_timestamp: End time in UTC of the last - successful capacity mode change. - :vartype capacity_mode_last_successful_transition_end_timestamp: ~datetime.datetime - """ - - _validation = { - "capacity_mode_transition_begin_timestamp": {"readonly": True}, - "capacity_mode_transition_end_timestamp": {"readonly": True}, - "capacity_mode_last_successful_transition_end_timestamp": {"readonly": True}, - } - - _attribute_map = { - "capacity_mode_transition_status": {"key": "capacityModeTransitionStatus", "type": "str"}, - "current_capacity_mode": {"key": "currentCapacityMode", "type": "str"}, - "previous_capacity_mode": {"key": "previousCapacityMode", "type": "str"}, - "capacity_mode_transition_begin_timestamp": {"key": "capacityModeTransitionBeginTimestamp", "type": "iso-8601"}, - "capacity_mode_transition_end_timestamp": {"key": "capacityModeTransitionEndTimestamp", "type": "iso-8601"}, - "capacity_mode_last_successful_transition_end_timestamp": { - "key": "capacityModeLastSuccessfulTransitionEndTimestamp", - "type": "iso-8601", - }, - } - - def __init__( - self, - *, - capacity_mode_transition_status: Optional[Union[str, "_models.CapacityModeTransitionStatus"]] = None, - current_capacity_mode: Optional[Union[str, "_models.CapacityMode"]] = None, - previous_capacity_mode: Optional[Union[str, "_models.CapacityMode"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword capacity_mode_transition_status: The transition status of capacity mode. Known values - are: "Invalid", "Initialized", "InProgress", "Completed", and "Failed". - :paramtype capacity_mode_transition_status: str or - ~azure.mgmt.cosmosdb.models.CapacityModeTransitionStatus - :keyword current_capacity_mode: Indicates the current capacity mode of the account. Known - values are: "None", "Provisioned", and "Serverless". - :paramtype current_capacity_mode: str or ~azure.mgmt.cosmosdb.models.CapacityMode - :keyword previous_capacity_mode: Indicates the previous capacity mode of the account before - successful transition. Known values are: "None", "Provisioned", and "Serverless". - :paramtype previous_capacity_mode: str or ~azure.mgmt.cosmosdb.models.CapacityMode - """ - super().__init__(**kwargs) - self.capacity_mode_transition_status = capacity_mode_transition_status - self.current_capacity_mode = current_capacity_mode - self.previous_capacity_mode = previous_capacity_mode - self.capacity_mode_transition_begin_timestamp = None - self.capacity_mode_transition_end_timestamp = None - self.capacity_mode_last_successful_transition_end_timestamp = None - - class CassandraClusterDataCenterNodeItem(_serialization.Model): """CassandraClusterDataCenterNodeItem. @@ -972,8 +548,6 @@ class CassandraClusterDataCenterNodeItem(_serialization.Model): :vartype memory_total_kb: int :ivar cpu_usage: A float representing the current system-wide CPU utilization as a percentage. :vartype cpu_usage: float - :ivar is_latest_model: If node has been updated to latest model. - :vartype is_latest_model: bool """ _attribute_map = { @@ -994,7 +568,6 @@ class CassandraClusterDataCenterNodeItem(_serialization.Model): "memory_free_kb": {"key": "memoryFreeKB", "type": "int"}, "memory_total_kb": {"key": "memoryTotalKB", "type": "int"}, "cpu_usage": {"key": "cpuUsage", "type": "float"}, - "is_latest_model": {"key": "isLatestModel", "type": "bool"}, } def __init__( @@ -1017,7 +590,6 @@ def __init__( memory_free_kb: Optional[int] = None, memory_total_kb: Optional[int] = None, cpu_usage: Optional[float] = None, - is_latest_model: Optional[bool] = None, **kwargs: Any ) -> None: """ @@ -1061,8 +633,6 @@ def __init__( :keyword cpu_usage: A float representing the current system-wide CPU utilization as a percentage. :paramtype cpu_usage: float - :keyword is_latest_model: If node has been updated to latest model. - :paramtype is_latest_model: bool """ super().__init__(**kwargs) self.address = address @@ -1082,7 +652,6 @@ def __init__( self.memory_free_kb = memory_free_kb self.memory_total_kb = memory_total_kb self.cpu_usage = cpu_usage - self.is_latest_model = is_latest_model class CassandraClusterPublicStatus(_serialization.Model): @@ -1251,8 +820,6 @@ class CassandraKeyspaceCreateUpdateParameters(ARMResourceProperties): with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :ivar resource: The standard JSON format of a Cassandra keyspace. Required. :vartype resource: ~azure.mgmt.cosmosdb.models.CassandraKeyspaceResource :ivar options: A key-value pair of options to be applied for the request. This corresponds to @@ -1273,7 +840,6 @@ class CassandraKeyspaceCreateUpdateParameters(ARMResourceProperties): "type": {"key": "type", "type": "str"}, "location": {"key": "location", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, "resource": {"key": "properties.resource", "type": "CassandraKeyspaceResource"}, "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, } @@ -1284,7 +850,6 @@ def __init__( resource: "_models.CassandraKeyspaceResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, **kwargs: Any ) -> None: @@ -1298,15 +863,13 @@ def __init__( with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :keyword resource: The standard JSON format of a Cassandra keyspace. Required. :paramtype resource: ~azure.mgmt.cosmosdb.models.CassandraKeyspaceResource :keyword options: A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -1481,8 +1044,6 @@ class CassandraKeyspaceGetResults(ARMResourceProperties): with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :ivar resource: :vartype resource: ~azure.mgmt.cosmosdb.models.CassandraKeyspaceGetPropertiesResource :ivar options: @@ -1501,7 +1062,6 @@ class CassandraKeyspaceGetResults(ARMResourceProperties): "type": {"key": "type", "type": "str"}, "location": {"key": "location", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, "resource": {"key": "properties.resource", "type": "CassandraKeyspaceGetPropertiesResource"}, "options": {"key": "properties.options", "type": "CassandraKeyspaceGetPropertiesOptions"}, } @@ -1511,7 +1071,6 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.CassandraKeyspaceGetPropertiesResource"] = None, options: Optional["_models.CassandraKeyspaceGetPropertiesOptions"] = None, **kwargs: Any @@ -1526,14 +1085,12 @@ def __init__( with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :keyword resource: :paramtype resource: ~azure.mgmt.cosmosdb.models.CassandraKeyspaceGetPropertiesResource :keyword options: :paramtype options: ~azure.mgmt.cosmosdb.models.CassandraKeyspaceGetPropertiesOptions """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -1642,8 +1199,6 @@ class CassandraTableCreateUpdateParameters(ARMResourceProperties): with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :ivar resource: The standard JSON format of a Cassandra table. Required. :vartype resource: ~azure.mgmt.cosmosdb.models.CassandraTableResource :ivar options: A key-value pair of options to be applied for the request. This corresponds to @@ -1664,7 +1219,6 @@ class CassandraTableCreateUpdateParameters(ARMResourceProperties): "type": {"key": "type", "type": "str"}, "location": {"key": "location", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, "resource": {"key": "properties.resource", "type": "CassandraTableResource"}, "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, } @@ -1675,7 +1229,6 @@ def __init__( resource: "_models.CassandraTableResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, **kwargs: Any ) -> None: @@ -1689,15 +1242,13 @@ def __init__( with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :keyword resource: The standard JSON format of a Cassandra table. Required. :paramtype resource: ~azure.mgmt.cosmosdb.models.CassandraTableResource :keyword options: A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -1857,8 +1408,6 @@ class CassandraTableGetResults(ARMResourceProperties): with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :ivar resource: :vartype resource: ~azure.mgmt.cosmosdb.models.CassandraTableGetPropertiesResource :ivar options: @@ -1877,7 +1426,6 @@ class CassandraTableGetResults(ARMResourceProperties): "type": {"key": "type", "type": "str"}, "location": {"key": "location", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, "resource": {"key": "properties.resource", "type": "CassandraTableGetPropertiesResource"}, "options": {"key": "properties.options", "type": "CassandraTableGetPropertiesOptions"}, } @@ -1887,7 +1435,6 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.CassandraTableGetPropertiesResource"] = None, options: Optional["_models.CassandraTableGetPropertiesOptions"] = None, **kwargs: Any @@ -1902,14 +1449,12 @@ def __init__( with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :keyword resource: :paramtype resource: ~azure.mgmt.cosmosdb.models.CassandraTableGetPropertiesResource :keyword options: :paramtype options: ~azure.mgmt.cosmosdb.models.CassandraTableGetPropertiesOptions """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -1937,139 +1482,170 @@ def __init__(self, **kwargs: Any) -> None: self.value = None -class CassandraViewCreateUpdateParameters(ARMResourceProperties): - """Parameters to create and update Cosmos DB Cassandra view. - - 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. +class Certificate(_serialization.Model): + """Certificate. - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar location: The location of the resource group to which the resource belongs. - :vartype location: str - :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :ivar resource: The standard JSON format of a Cassandra view. Required. - :vartype resource: ~azure.mgmt.cosmosdb.models.CassandraViewResource - :ivar options: A key-value pair of options to be applied for the request. This corresponds to - the headers sent with the request. - :vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions + :ivar pem: PEM formatted public key. + :vartype pem: str """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "resource": {"required": True}, - } - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "resource": {"key": "properties.resource", "type": "CassandraViewResource"}, - "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, + "pem": {"key": "pem", "type": "str"}, } - def __init__( - self, - *, - resource: "_models.CassandraViewResource", - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - options: Optional["_models.CreateUpdateOptions"] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, pem: Optional[str] = None, **kwargs: Any) -> None: """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :keyword resource: The standard JSON format of a Cassandra view. Required. - :paramtype resource: ~azure.mgmt.cosmosdb.models.CassandraViewResource - :keyword options: A key-value pair of options to be applied for the request. This corresponds - to the headers sent with the request. - :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions + :keyword pem: PEM formatted public key. + :paramtype pem: str """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.resource = resource - self.options = options + super().__init__(**kwargs) + self.pem = pem -class CassandraViewGetPropertiesOptions(OptionsResource): - """CassandraViewGetPropertiesOptions. +class ClientEncryptionIncludedPath(_serialization.Model): + """. - :ivar throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the - ThroughputSetting resource when retrieving offer details. - :vartype throughput: int - :ivar autoscale_settings: Specifies the Autoscale settings. - :vartype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings + All required parameters must be populated in order to send to server. + + :ivar path: Path that needs to be encrypted. Required. + :vartype path: str + :ivar client_encryption_key_id: The identifier of the Client Encryption Key to be used to + encrypt the path. Required. + :vartype client_encryption_key_id: str + :ivar encryption_type: The type of encryption to be performed. Eg - Deterministic, Randomized. + Required. + :vartype encryption_type: str + :ivar encryption_algorithm: The encryption algorithm which will be used. Eg - + AEAD_AES_256_CBC_HMAC_SHA256. Required. + :vartype encryption_algorithm: str """ + _validation = { + "path": {"required": True}, + "client_encryption_key_id": {"required": True}, + "encryption_type": {"required": True}, + "encryption_algorithm": {"required": True}, + } + + _attribute_map = { + "path": {"key": "path", "type": "str"}, + "client_encryption_key_id": {"key": "clientEncryptionKeyId", "type": "str"}, + "encryption_type": {"key": "encryptionType", "type": "str"}, + "encryption_algorithm": {"key": "encryptionAlgorithm", "type": "str"}, + } + + def __init__( + self, + *, + path: str, + client_encryption_key_id: str, + encryption_type: str, + encryption_algorithm: str, + **kwargs: Any + ) -> None: + """ + :keyword path: Path that needs to be encrypted. Required. + :paramtype path: str + :keyword client_encryption_key_id: The identifier of the Client Encryption Key to be used to + encrypt the path. Required. + :paramtype client_encryption_key_id: str + :keyword encryption_type: The type of encryption to be performed. Eg - Deterministic, + Randomized. Required. + :paramtype encryption_type: str + :keyword encryption_algorithm: The encryption algorithm which will be used. Eg - + AEAD_AES_256_CBC_HMAC_SHA256. Required. + :paramtype encryption_algorithm: str + """ + super().__init__(**kwargs) + self.path = path + self.client_encryption_key_id = client_encryption_key_id + self.encryption_type = encryption_type + self.encryption_algorithm = encryption_algorithm + -class CassandraViewResource(_serialization.Model): - """Cosmos DB Cassandra view resource object. +class ClientEncryptionKeyCreateUpdateParameters(_serialization.Model): # pylint: disable=name-too-long + """Parameters to create and update ClientEncryptionKey. All required parameters must be populated in order to send to server. - :ivar id: Name of the Cosmos DB Cassandra view. Required. - :vartype id: str - :ivar view_definition: View Definition of the Cosmos DB Cassandra view. Required. - :vartype view_definition: str + :ivar resource: The standard JSON format of a ClientEncryptionKey. Required. + :vartype resource: ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyResource """ _validation = { - "id": {"required": True}, - "view_definition": {"required": True}, + "resource": {"required": True}, + } + + _attribute_map = { + "resource": {"key": "properties.resource", "type": "ClientEncryptionKeyResource"}, } + def __init__(self, *, resource: "_models.ClientEncryptionKeyResource", **kwargs: Any) -> None: + """ + :keyword resource: The standard JSON format of a ClientEncryptionKey. Required. + :paramtype resource: ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyResource + """ + super().__init__(**kwargs) + self.resource = resource + + +class ClientEncryptionKeyResource(_serialization.Model): + """Cosmos DB client encryption key resource object. + + :ivar id: Name of the ClientEncryptionKey. + :vartype id: str + :ivar encryption_algorithm: Encryption algorithm that will be used along with this client + encryption key to encrypt/decrypt data. + :vartype encryption_algorithm: str + :ivar wrapped_data_encryption_key: Wrapped (encrypted) form of the key represented as a byte + array. + :vartype wrapped_data_encryption_key: bytes + :ivar key_wrap_metadata: Metadata for the wrapping provider that can be used to unwrap the + wrapped client encryption key. + :vartype key_wrap_metadata: ~azure.mgmt.cosmosdb.models.KeyWrapMetadata + """ + _attribute_map = { "id": {"key": "id", "type": "str"}, - "view_definition": {"key": "viewDefinition", "type": "str"}, + "encryption_algorithm": {"key": "encryptionAlgorithm", "type": "str"}, + "wrapped_data_encryption_key": {"key": "wrappedDataEncryptionKey", "type": "bytearray"}, + "key_wrap_metadata": {"key": "keyWrapMetadata", "type": "KeyWrapMetadata"}, } - def __init__(self, *, id: str, view_definition: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + encryption_algorithm: Optional[str] = None, + wrapped_data_encryption_key: Optional[bytes] = None, + key_wrap_metadata: Optional["_models.KeyWrapMetadata"] = None, + **kwargs: Any + ) -> None: """ - :keyword id: Name of the Cosmos DB Cassandra view. Required. + :keyword id: Name of the ClientEncryptionKey. :paramtype id: str - :keyword view_definition: View Definition of the Cosmos DB Cassandra view. Required. - :paramtype view_definition: str + :keyword encryption_algorithm: Encryption algorithm that will be used along with this client + encryption key to encrypt/decrypt data. + :paramtype encryption_algorithm: str + :keyword wrapped_data_encryption_key: Wrapped (encrypted) form of the key represented as a byte + array. + :paramtype wrapped_data_encryption_key: bytes + :keyword key_wrap_metadata: Metadata for the wrapping provider that can be used to unwrap the + wrapped client encryption key. + :paramtype key_wrap_metadata: ~azure.mgmt.cosmosdb.models.KeyWrapMetadata """ super().__init__(**kwargs) self.id = id - self.view_definition = view_definition + self.encryption_algorithm = encryption_algorithm + self.wrapped_data_encryption_key = wrapped_data_encryption_key + self.key_wrap_metadata = key_wrap_metadata -class CassandraViewGetPropertiesResource(CassandraViewResource, ExtendedResourceProperties): - """CassandraViewGetPropertiesResource. +class ClientEncryptionKeyGetPropertiesResource(ClientEncryptionKeyResource, ExtendedResourceProperties): + """ClientEncryptionKeyGetPropertiesResource. 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 rid: A system generated property. A unique identifier. :vartype rid: str :ivar ts: A system generated property that denotes the last updated timestamp of the resource. @@ -2077,18 +1653,23 @@ class CassandraViewGetPropertiesResource(CassandraViewResource, ExtendedResource :ivar etag: A system generated property representing the resource etag required for optimistic concurrency control. :vartype etag: str - :ivar id: Name of the Cosmos DB Cassandra view. Required. + :ivar id: Name of the ClientEncryptionKey. :vartype id: str - :ivar view_definition: View Definition of the Cosmos DB Cassandra view. Required. - :vartype view_definition: str + :ivar encryption_algorithm: Encryption algorithm that will be used along with this client + encryption key to encrypt/decrypt data. + :vartype encryption_algorithm: str + :ivar wrapped_data_encryption_key: Wrapped (encrypted) form of the key represented as a byte + array. + :vartype wrapped_data_encryption_key: bytes + :ivar key_wrap_metadata: Metadata for the wrapping provider that can be used to unwrap the + wrapped client encryption key. + :vartype key_wrap_metadata: ~azure.mgmt.cosmosdb.models.KeyWrapMetadata """ _validation = { "rid": {"readonly": True}, "ts": {"readonly": True}, "etag": {"readonly": True}, - "id": {"required": True}, - "view_definition": {"required": True}, } _attribute_map = { @@ -2096,50 +1677,62 @@ class CassandraViewGetPropertiesResource(CassandraViewResource, ExtendedResource "ts": {"key": "_ts", "type": "float"}, "etag": {"key": "_etag", "type": "str"}, "id": {"key": "id", "type": "str"}, - "view_definition": {"key": "viewDefinition", "type": "str"}, + "encryption_algorithm": {"key": "encryptionAlgorithm", "type": "str"}, + "wrapped_data_encryption_key": {"key": "wrappedDataEncryptionKey", "type": "bytearray"}, + "key_wrap_metadata": {"key": "keyWrapMetadata", "type": "KeyWrapMetadata"}, } - def __init__(self, *, id: str, view_definition: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + encryption_algorithm: Optional[str] = None, + wrapped_data_encryption_key: Optional[bytes] = None, + key_wrap_metadata: Optional["_models.KeyWrapMetadata"] = None, + **kwargs: Any + ) -> None: """ - :keyword id: Name of the Cosmos DB Cassandra view. Required. + :keyword id: Name of the ClientEncryptionKey. :paramtype id: str - :keyword view_definition: View Definition of the Cosmos DB Cassandra view. Required. - :paramtype view_definition: str + :keyword encryption_algorithm: Encryption algorithm that will be used along with this client + encryption key to encrypt/decrypt data. + :paramtype encryption_algorithm: str + :keyword wrapped_data_encryption_key: Wrapped (encrypted) form of the key represented as a byte + array. + :paramtype wrapped_data_encryption_key: bytes + :keyword key_wrap_metadata: Metadata for the wrapping provider that can be used to unwrap the + wrapped client encryption key. + :paramtype key_wrap_metadata: ~azure.mgmt.cosmosdb.models.KeyWrapMetadata """ - super().__init__(id=id, view_definition=view_definition, **kwargs) + super().__init__( + id=id, + encryption_algorithm=encryption_algorithm, + wrapped_data_encryption_key=wrapped_data_encryption_key, + key_wrap_metadata=key_wrap_metadata, + **kwargs + ) self.rid = None self.ts = None self.etag = None self.id = id - self.view_definition = view_definition + self.encryption_algorithm = encryption_algorithm + self.wrapped_data_encryption_key = wrapped_data_encryption_key + self.key_wrap_metadata = key_wrap_metadata -class CassandraViewGetResults(ARMResourceProperties): - """An Azure Cosmos DB Cassandra view. +class ClientEncryptionKeyGetResults(ARMProxyResource): + """Client Encryption Key. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The unique resource identifier of the ARM resource. + :ivar id: The unique resource identifier of the database account. :vartype id: str - :ivar name: The name of the ARM resource. + :ivar name: The name of the database account. :vartype name: str :ivar type: The type of Azure resource. :vartype type: str - :ivar location: The location of the resource group to which the resource belongs. - :vartype location: str - :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :ivar resource: - :vartype resource: ~azure.mgmt.cosmosdb.models.CassandraViewGetPropertiesResource - :ivar options: - :vartype options: ~azure.mgmt.cosmosdb.models.CassandraViewGetPropertiesOptions + :vartype resource: ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetPropertiesResource """ _validation = { @@ -2152,52 +1745,27 @@ class CassandraViewGetResults(ARMResourceProperties): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "resource": {"key": "properties.resource", "type": "CassandraViewGetPropertiesResource"}, - "options": {"key": "properties.options", "type": "CassandraViewGetPropertiesOptions"}, + "resource": {"key": "properties.resource", "type": "ClientEncryptionKeyGetPropertiesResource"}, } def __init__( - self, - *, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - resource: Optional["_models.CassandraViewGetPropertiesResource"] = None, - options: Optional["_models.CassandraViewGetPropertiesOptions"] = None, - **kwargs: Any + self, *, resource: Optional["_models.ClientEncryptionKeyGetPropertiesResource"] = None, **kwargs: Any ) -> None: """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :keyword resource: - :paramtype resource: ~azure.mgmt.cosmosdb.models.CassandraViewGetPropertiesResource - :keyword options: - :paramtype options: ~azure.mgmt.cosmosdb.models.CassandraViewGetPropertiesOptions + :paramtype resource: ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetPropertiesResource """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(**kwargs) self.resource = resource - self.options = options -class CassandraViewListResult(_serialization.Model): - """The List operation response, that contains the Cassandra views and their properties. +class ClientEncryptionKeysListResult(_serialization.Model): + """The List operation response, that contains the client encryption keys and their properties. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of Cassandra views and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.CassandraViewGetResults] + :ivar value: List of client encryption keys and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] """ _validation = { @@ -2205,7 +1773,7 @@ class CassandraViewListResult(_serialization.Model): } _attribute_map = { - "value": {"key": "value", "type": "[CassandraViewGetResults]"}, + "value": {"key": "value", "type": "[ClientEncryptionKeyGetResults]"}, } def __init__(self, **kwargs: Any) -> None: @@ -2214,4734 +1782,1075 @@ def __init__(self, **kwargs: Any) -> None: self.value = None -class Certificate(_serialization.Model): - """Certificate. +class ClientEncryptionPolicy(_serialization.Model): + """Cosmos DB client encryption policy. - :ivar pem: PEM formatted public key. - :vartype pem: str - """ + All required parameters must be populated in order to send to server. - _attribute_map = { - "pem": {"key": "pem", "type": "str"}, + :ivar included_paths: Paths of the item that need encryption along with path-specific settings. + Required. + :vartype included_paths: list[~azure.mgmt.cosmosdb.models.ClientEncryptionIncludedPath] + :ivar policy_format_version: Version of the client encryption policy definition. Supported + versions are 1 and 2. Version 2 supports id and partition key path encryption. Required. + :vartype policy_format_version: int + """ + + _validation = { + "included_paths": {"required": True}, + "policy_format_version": {"required": True, "maximum": 2, "minimum": 1}, } - def __init__(self, *, pem: Optional[str] = None, **kwargs: Any) -> None: + _attribute_map = { + "included_paths": {"key": "includedPaths", "type": "[ClientEncryptionIncludedPath]"}, + "policy_format_version": {"key": "policyFormatVersion", "type": "int"}, + } + + def __init__( + self, *, included_paths: List["_models.ClientEncryptionIncludedPath"], policy_format_version: int, **kwargs: Any + ) -> None: """ - :keyword pem: PEM formatted public key. - :paramtype pem: str + :keyword included_paths: Paths of the item that need encryption along with path-specific + settings. Required. + :paramtype included_paths: list[~azure.mgmt.cosmosdb.models.ClientEncryptionIncludedPath] + :keyword policy_format_version: Version of the client encryption policy definition. Supported + versions are 1 and 2. Version 2 supports id and partition key path encryption. Required. + :paramtype policy_format_version: int """ super().__init__(**kwargs) - self.pem = pem - + self.included_paths = included_paths + self.policy_format_version = policy_format_version -class ChaosFaultListResponse(_serialization.Model): - """Chaos Fault List Response. - Variables are only populated by the server, and will be ignored when sending a request. +class ClusterKey(_serialization.Model): + """Cosmos DB Cassandra table cluster key. - :ivar value: List of Chaos Faults. - :vartype value: list[~azure.mgmt.cosmosdb.models.ChaosFaultResource] - :ivar next_link: The link used to get the next page of results. - :vartype next_link: str + :ivar name: Name of the Cosmos DB Cassandra table cluster key. + :vartype name: str + :ivar order_by: Order of the Cosmos DB Cassandra table cluster key, only support "Asc" and + "Desc". + :vartype order_by: str """ - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - _attribute_map = { - "value": {"key": "value", "type": "[ChaosFaultResource]"}, - "next_link": {"key": "nextLink", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "order_by": {"key": "orderBy", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, name: Optional[str] = None, order_by: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword name: Name of the Cosmos DB Cassandra table cluster key. + :paramtype name: str + :keyword order_by: Order of the Cosmos DB Cassandra table cluster key, only support "Asc" and + "Desc". + :paramtype order_by: str + """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.name = name + self.order_by = order_by -class Resource(_serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. +class ManagedCassandraARMResourceProperties(_serialization.Model): + """The core properties of ARM 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 + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str - :ivar name: The name of the resource. + :ivar name: The name of the ARM resource. :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". + :ivar type: The type of Azure resource. :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cosmosdb.models.SystemData + :ivar location: The location of the resource group to which the resource belongs. + :vartype location: str + :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :vartype tags: dict[str, str] + :ivar identity: Identity for the resource. + :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedCassandraManagedServiceIdentity """ _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"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "identity": {"key": "identity", "type": "ManagedCassandraManagedServiceIdentity"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + identity: Optional["_models.ManagedCassandraManagedServiceIdentity"] = None, + **kwargs: Any + ) -> None: + """ + :keyword location: The location of the resource group to which the resource belongs. + :paramtype location: str + :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :paramtype tags: dict[str, str] + :keyword identity: Identity for the resource. + :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedCassandraManagedServiceIdentity + """ super().__init__(**kwargs) self.id = None self.name = None self.type = None - self.system_data = None - - -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.cosmosdb.models.SystemData - """ + self.location = location + self.tags = tags + self.identity = identity -class ChaosFaultResource(ProxyResource): - """A request object to enable/disable the chaos fault. +class ClusterResource(ManagedCassandraARMResourceProperties): + """Representation of a managed Cassandra cluster. 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 + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str - :ivar name: The name of the resource. + :ivar name: The name of the ARM resource. :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". + :ivar type: The type of Azure resource. :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cosmosdb.models.SystemData - :ivar action: Indicates whether what action to take for the Chaos Fault. Known values are: - "Enable" and "Disable". - :vartype action: str or ~azure.mgmt.cosmosdb.models.SupportedActions - :ivar region: Region of the account where the Chaos Fault is to be enabled/disabled. - :vartype region: str - :ivar database_name: Database name. - :vartype database_name: str - :ivar container_name: Container name. - :vartype container_name: str - :ivar provisioning_state: A provisioning state of the Chaos Fault. - :vartype provisioning_state: str + :ivar location: The location of the resource group to which the resource belongs. + :vartype location: str + :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :vartype tags: dict[str, str] + :ivar identity: Identity for the resource. + :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedCassandraManagedServiceIdentity + :ivar properties: Properties of a managed Cassandra cluster. + :vartype properties: ~azure.mgmt.cosmosdb.models.ClusterResourceProperties """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"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"}, - "action": {"key": "properties.action", "type": "str"}, - "region": {"key": "properties.region", "type": "str"}, - "database_name": {"key": "properties.databaseName", "type": "str"}, - "container_name": {"key": "properties.containerName", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "identity": {"key": "identity", "type": "ManagedCassandraManagedServiceIdentity"}, + "properties": {"key": "properties", "type": "ClusterResourceProperties"}, } def __init__( self, *, - action: Optional[Union[str, "_models.SupportedActions"]] = None, - region: Optional[str] = None, - database_name: Optional[str] = None, - container_name: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + identity: Optional["_models.ManagedCassandraManagedServiceIdentity"] = None, + properties: Optional["_models.ClusterResourceProperties"] = None, **kwargs: Any ) -> None: """ - :keyword action: Indicates whether what action to take for the Chaos Fault. Known values are: - "Enable" and "Disable". - :paramtype action: str or ~azure.mgmt.cosmosdb.models.SupportedActions - :keyword region: Region of the account where the Chaos Fault is to be enabled/disabled. - :paramtype region: str - :keyword database_name: Database name. - :paramtype database_name: str - :keyword container_name: Container name. - :paramtype container_name: str + :keyword location: The location of the resource group to which the resource belongs. + :paramtype location: str + :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :paramtype tags: dict[str, str] + :keyword identity: Identity for the resource. + :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedCassandraManagedServiceIdentity + :keyword properties: Properties of a managed Cassandra cluster. + :paramtype properties: ~azure.mgmt.cosmosdb.models.ClusterResourceProperties """ - super().__init__(**kwargs) - self.action = action - self.region = region - self.database_name = database_name - self.container_name = container_name - self.provisioning_state = None - - -class ClientEncryptionIncludedPath(_serialization.Model): - """. - - All required parameters must be populated in order to send to server. - - :ivar path: Path that needs to be encrypted. Required. - :vartype path: str - :ivar client_encryption_key_id: The identifier of the Client Encryption Key to be used to - encrypt the path. Required. - :vartype client_encryption_key_id: str - :ivar encryption_type: The type of encryption to be performed. Eg - Deterministic, Randomized. - Required. - :vartype encryption_type: str - :ivar encryption_algorithm: The encryption algorithm which will be used. Eg - - AEAD_AES_256_CBC_HMAC_SHA256. Required. - :vartype encryption_algorithm: str - """ - - _validation = { - "path": {"required": True}, - "client_encryption_key_id": {"required": True}, - "encryption_type": {"required": True}, - "encryption_algorithm": {"required": True}, - } - - _attribute_map = { - "path": {"key": "path", "type": "str"}, - "client_encryption_key_id": {"key": "clientEncryptionKeyId", "type": "str"}, - "encryption_type": {"key": "encryptionType", "type": "str"}, - "encryption_algorithm": {"key": "encryptionAlgorithm", "type": "str"}, - } + super().__init__(location=location, tags=tags, identity=identity, **kwargs) + self.properties = properties - def __init__( - self, - *, - path: str, - client_encryption_key_id: str, - encryption_type: str, - encryption_algorithm: str, - **kwargs: Any - ) -> None: - """ - :keyword path: Path that needs to be encrypted. Required. - :paramtype path: str - :keyword client_encryption_key_id: The identifier of the Client Encryption Key to be used to - encrypt the path. Required. - :paramtype client_encryption_key_id: str - :keyword encryption_type: The type of encryption to be performed. Eg - Deterministic, - Randomized. Required. - :paramtype encryption_type: str - :keyword encryption_algorithm: The encryption algorithm which will be used. Eg - - AEAD_AES_256_CBC_HMAC_SHA256. Required. - :paramtype encryption_algorithm: str - """ - super().__init__(**kwargs) - self.path = path - self.client_encryption_key_id = client_encryption_key_id - self.encryption_type = encryption_type - self.encryption_algorithm = encryption_algorithm +class ClusterResourceProperties(_serialization.Model): + """Properties of a managed Cassandra cluster. -class ClientEncryptionKeyCreateUpdateParameters(_serialization.Model): # pylint: disable=name-too-long - """Parameters to create and update ClientEncryptionKey. + 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 resource: The standard JSON format of a ClientEncryptionKey. Required. - :vartype resource: ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyResource - """ - - _validation = { - "resource": {"required": True}, - } - - _attribute_map = { - "resource": {"key": "properties.resource", "type": "ClientEncryptionKeyResource"}, - } - - def __init__(self, *, resource: "_models.ClientEncryptionKeyResource", **kwargs: Any) -> None: - """ - :keyword resource: The standard JSON format of a ClientEncryptionKey. Required. - :paramtype resource: ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyResource - """ - super().__init__(**kwargs) - self.resource = resource - - -class ClientEncryptionKeyResource(_serialization.Model): - """Cosmos DB client encryption key resource object. - - :ivar id: Name of the ClientEncryptionKey. - :vartype id: str - :ivar encryption_algorithm: Encryption algorithm that will be used along with this client - encryption key to encrypt/decrypt data. - :vartype encryption_algorithm: str - :ivar wrapped_data_encryption_key: Wrapped (encrypted) form of the key represented as a byte - array. - :vartype wrapped_data_encryption_key: bytes - :ivar key_wrap_metadata: Metadata for the wrapping provider that can be used to unwrap the - wrapped client encryption key. - :vartype key_wrap_metadata: ~azure.mgmt.cosmosdb.models.KeyWrapMetadata - """ - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "encryption_algorithm": {"key": "encryptionAlgorithm", "type": "str"}, - "wrapped_data_encryption_key": {"key": "wrappedDataEncryptionKey", "type": "bytearray"}, - "key_wrap_metadata": {"key": "keyWrapMetadata", "type": "KeyWrapMetadata"}, - } - - def __init__( - self, - *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - encryption_algorithm: Optional[str] = None, - wrapped_data_encryption_key: Optional[bytes] = None, - key_wrap_metadata: Optional["_models.KeyWrapMetadata"] = None, - **kwargs: Any - ) -> None: - """ - :keyword id: Name of the ClientEncryptionKey. - :paramtype id: str - :keyword encryption_algorithm: Encryption algorithm that will be used along with this client - encryption key to encrypt/decrypt data. - :paramtype encryption_algorithm: str - :keyword wrapped_data_encryption_key: Wrapped (encrypted) form of the key represented as a byte - array. - :paramtype wrapped_data_encryption_key: bytes - :keyword key_wrap_metadata: Metadata for the wrapping provider that can be used to unwrap the - wrapped client encryption key. - :paramtype key_wrap_metadata: ~azure.mgmt.cosmosdb.models.KeyWrapMetadata - """ - super().__init__(**kwargs) - self.id = id - self.encryption_algorithm = encryption_algorithm - self.wrapped_data_encryption_key = wrapped_data_encryption_key - self.key_wrap_metadata = key_wrap_metadata - - -class ClientEncryptionKeyGetPropertiesResource(ClientEncryptionKeyResource, ExtendedResourceProperties): - """ClientEncryptionKeyGetPropertiesResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar rid: A system generated property. A unique identifier. - :vartype rid: str - :ivar ts: A system generated property that denotes the last updated timestamp of the resource. - :vartype ts: float - :ivar etag: A system generated property representing the resource etag required for optimistic - concurrency control. - :vartype etag: str - :ivar id: Name of the ClientEncryptionKey. - :vartype id: str - :ivar encryption_algorithm: Encryption algorithm that will be used along with this client - encryption key to encrypt/decrypt data. - :vartype encryption_algorithm: str - :ivar wrapped_data_encryption_key: Wrapped (encrypted) form of the key represented as a byte - array. - :vartype wrapped_data_encryption_key: bytes - :ivar key_wrap_metadata: Metadata for the wrapping provider that can be used to unwrap the - wrapped client encryption key. - :vartype key_wrap_metadata: ~azure.mgmt.cosmosdb.models.KeyWrapMetadata - """ - - _validation = { - "rid": {"readonly": True}, - "ts": {"readonly": True}, - "etag": {"readonly": True}, - } - - _attribute_map = { - "rid": {"key": "_rid", "type": "str"}, - "ts": {"key": "_ts", "type": "float"}, - "etag": {"key": "_etag", "type": "str"}, - "id": {"key": "id", "type": "str"}, - "encryption_algorithm": {"key": "encryptionAlgorithm", "type": "str"}, - "wrapped_data_encryption_key": {"key": "wrappedDataEncryptionKey", "type": "bytearray"}, - "key_wrap_metadata": {"key": "keyWrapMetadata", "type": "KeyWrapMetadata"}, - } - - def __init__( - self, - *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - encryption_algorithm: Optional[str] = None, - wrapped_data_encryption_key: Optional[bytes] = None, - key_wrap_metadata: Optional["_models.KeyWrapMetadata"] = None, - **kwargs: Any - ) -> None: - """ - :keyword id: Name of the ClientEncryptionKey. - :paramtype id: str - :keyword encryption_algorithm: Encryption algorithm that will be used along with this client - encryption key to encrypt/decrypt data. - :paramtype encryption_algorithm: str - :keyword wrapped_data_encryption_key: Wrapped (encrypted) form of the key represented as a byte - array. - :paramtype wrapped_data_encryption_key: bytes - :keyword key_wrap_metadata: Metadata for the wrapping provider that can be used to unwrap the - wrapped client encryption key. - :paramtype key_wrap_metadata: ~azure.mgmt.cosmosdb.models.KeyWrapMetadata - """ - super().__init__( - id=id, - encryption_algorithm=encryption_algorithm, - wrapped_data_encryption_key=wrapped_data_encryption_key, - key_wrap_metadata=key_wrap_metadata, - **kwargs - ) - self.rid = None - self.ts = None - self.etag = None - self.id = id - self.encryption_algorithm = encryption_algorithm - self.wrapped_data_encryption_key = wrapped_data_encryption_key - self.key_wrap_metadata = key_wrap_metadata - - -class ClientEncryptionKeyGetResults(ARMProxyResource): - """Client Encryption Key. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The unique resource identifier of the database account. - :vartype id: str - :ivar name: The name of the database account. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar resource: - :vartype resource: ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetPropertiesResource - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "resource": {"key": "properties.resource", "type": "ClientEncryptionKeyGetPropertiesResource"}, - } - - def __init__( - self, *, resource: Optional["_models.ClientEncryptionKeyGetPropertiesResource"] = None, **kwargs: Any - ) -> None: - """ - :keyword resource: - :paramtype resource: ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetPropertiesResource - """ - super().__init__(**kwargs) - self.resource = resource - - -class ClientEncryptionKeysListResult(_serialization.Model): - """The List operation response, that contains the client encryption keys and their properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of client encryption keys and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] - """ - - _validation = { - "value": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ClientEncryptionKeyGetResults]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - - -class ClientEncryptionPolicy(_serialization.Model): - """Cosmos DB client encryption policy. - - All required parameters must be populated in order to send to server. - - :ivar included_paths: Paths of the item that need encryption along with path-specific settings. - Required. - :vartype included_paths: list[~azure.mgmt.cosmosdb.models.ClientEncryptionIncludedPath] - :ivar policy_format_version: Version of the client encryption policy definition. Supported - versions are 1 and 2. Version 2 supports id and partition key path encryption. Required. - :vartype policy_format_version: int - """ - - _validation = { - "included_paths": {"required": True}, - "policy_format_version": {"required": True, "maximum": 2, "minimum": 1}, - } - - _attribute_map = { - "included_paths": {"key": "includedPaths", "type": "[ClientEncryptionIncludedPath]"}, - "policy_format_version": {"key": "policyFormatVersion", "type": "int"}, - } - - def __init__( - self, *, included_paths: List["_models.ClientEncryptionIncludedPath"], policy_format_version: int, **kwargs: Any - ) -> None: - """ - :keyword included_paths: Paths of the item that need encryption along with path-specific - settings. Required. - :paramtype included_paths: list[~azure.mgmt.cosmosdb.models.ClientEncryptionIncludedPath] - :keyword policy_format_version: Version of the client encryption policy definition. Supported - versions are 1 and 2. Version 2 supports id and partition key path encryption. Required. - :paramtype policy_format_version: int - """ - super().__init__(**kwargs) - self.included_paths = included_paths - self.policy_format_version = policy_format_version - - -class ClusterKey(_serialization.Model): - """Cosmos DB Cassandra table cluster key. - - :ivar name: Name of the Cosmos DB Cassandra table cluster key. - :vartype name: str - :ivar order_by: Order of the Cosmos DB Cassandra table cluster key, only support "Asc" and - "Desc". - :vartype order_by: str - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "order_by": {"key": "orderBy", "type": "str"}, - } - - def __init__(self, *, name: Optional[str] = None, order_by: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword name: Name of the Cosmos DB Cassandra table cluster key. - :paramtype name: str - :keyword order_by: Order of the Cosmos DB Cassandra table cluster key, only support "Asc" and - "Desc". - :paramtype order_by: str - """ - super().__init__(**kwargs) - self.name = name - self.order_by = order_by - - -class ManagedCassandraARMResourceProperties(_serialization.Model): - """The core properties of ARM resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar location: The location of the resource group to which the resource belongs. - :vartype location: str - :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedCassandraManagedServiceIdentity - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedCassandraManagedServiceIdentity"}, - } - - def __init__( - self, - *, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedCassandraManagedServiceIdentity"] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedCassandraManagedServiceIdentity - """ - super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = location - self.tags = tags - self.identity = identity - - -class ClusterResource(ManagedCassandraARMResourceProperties): - """Representation of a managed Cassandra cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar location: The location of the resource group to which the resource belongs. - :vartype location: str - :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedCassandraManagedServiceIdentity - :ivar properties: Properties of a managed Cassandra cluster. - :vartype properties: ~azure.mgmt.cosmosdb.models.ClusterResourceProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedCassandraManagedServiceIdentity"}, - "properties": {"key": "properties", "type": "ClusterResourceProperties"}, - } - - def __init__( - self, - *, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedCassandraManagedServiceIdentity"] = None, - properties: Optional["_models.ClusterResourceProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedCassandraManagedServiceIdentity - :keyword properties: Properties of a managed Cassandra cluster. - :paramtype properties: ~azure.mgmt.cosmosdb.models.ClusterResourceProperties - """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.properties = properties - - -class ClusterResourceProperties(_serialization.Model): - """Properties of a managed Cassandra cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provisioning_state: The status of the resource at the time the operation was called. - Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.cosmosdb.models.ManagedCassandraProvisioningState - :ivar restore_from_backup_id: To create an empty cluster, omit this field or set it to null. To - restore a backup into a new cluster, set this field to the resource id of the backup. - :vartype restore_from_backup_id: str - :ivar delegated_management_subnet_id: Resource id of a subnet that this cluster's management - service should have its network interface attached to. The subnet must be routable to all - subnets that will be delegated to data centers. The resource id must be of the form - '/subscriptions/:code:``/resourceGroups/:code:``/providers/Microsoft.Network/virtualNetworks/:code:``/subnets/:code:``'. - :vartype delegated_management_subnet_id: str - :ivar cassandra_version: Which version of Cassandra should this cluster converge to running - (e.g., 3.11). When updated, the cluster may take some time to migrate to the new version. - :vartype cassandra_version: str - :ivar cluster_name_override: If you need to set the clusterName property in cassandra.yaml to - something besides the resource name of the cluster, set the value to use on this property. - :vartype cluster_name_override: str - :ivar authentication_method: Which authentication method Cassandra should use to authenticate - clients. 'None' turns off authentication, so should not be used except in emergencies. - 'Cassandra' is the default password based authentication. The default is 'Cassandra'. Known - values are: "None", "Cassandra", and "Ldap". - :vartype authentication_method: str or ~azure.mgmt.cosmosdb.models.AuthenticationMethod - :ivar initial_cassandra_admin_password: Initial password for clients connecting as admin to the - cluster. Should be changed after cluster creation. Returns null on GET. This field only applies - when the authenticationMethod field is 'Cassandra'. - :vartype initial_cassandra_admin_password: str - :ivar prometheus_endpoint: Hostname or IP address where the Prometheus endpoint containing data - about the managed Cassandra nodes can be reached. - :vartype prometheus_endpoint: ~azure.mgmt.cosmosdb.models.SeedNode - :ivar repair_enabled: Should automatic repairs run on this cluster? If omitted, this is true, - and should stay true unless you are running a hybrid cluster where you are already doing your - own repairs. - :vartype repair_enabled: bool - :ivar auto_replicate: The form of AutoReplicate that is being used by this cluster. Known - values are: "None", "SystemKeyspaces", and "AllKeyspaces". - :vartype auto_replicate: str or ~azure.mgmt.cosmosdb.models.AutoReplicate - :ivar client_certificates: List of TLS certificates used to authorize clients connecting to the - cluster. All connections are TLS encrypted whether clientCertificates is set or not, but if - clientCertificates is set, the managed Cassandra cluster will reject all connections not - bearing a TLS client certificate that can be validated from one or more of the public - certificates in this property. - :vartype client_certificates: list[~azure.mgmt.cosmosdb.models.Certificate] - :ivar external_gossip_certificates: List of TLS certificates used to authorize gossip from - unmanaged data centers. The TLS certificates of all nodes in unmanaged data centers must be - verifiable using one of the certificates provided in this property. - :vartype external_gossip_certificates: list[~azure.mgmt.cosmosdb.models.Certificate] - :ivar gossip_certificates: List of TLS certificates that unmanaged nodes must trust for gossip - with managed nodes. All managed nodes will present TLS client certificates that are verifiable - using one of the certificates provided in this property. - :vartype gossip_certificates: list[~azure.mgmt.cosmosdb.models.Certificate] - :ivar external_seed_nodes: List of IP addresses of seed nodes in unmanaged data centers. These - will be added to the seed node lists of all managed nodes. - :vartype external_seed_nodes: list[~azure.mgmt.cosmosdb.models.SeedNode] - :ivar seed_nodes: List of IP addresses of seed nodes in the managed data centers. These should - be added to the seed node lists of all unmanaged nodes. - :vartype seed_nodes: list[~azure.mgmt.cosmosdb.models.SeedNode] - :ivar external_data_centers: List of the data center names for unmanaged data centers in this - cluster to be included in auto-replication. - :vartype external_data_centers: list[str] - :ivar hours_between_backups: (Deprecated) Number of hours to wait between taking a backup of - the cluster. - :vartype hours_between_backups: int - :ivar deallocated: Whether the cluster and associated data centers has been deallocated. - :vartype deallocated: bool - :ivar cassandra_audit_logging_enabled: Whether Cassandra audit logging is enabled. - :vartype cassandra_audit_logging_enabled: bool - :ivar cluster_type: Type of the cluster. If set to Production, some operations might not be - permitted on cluster. Known values are: "Production" and "NonProduction". - :vartype cluster_type: str or ~azure.mgmt.cosmosdb.models.ClusterType - :ivar provision_error: Error related to resource provisioning. - :vartype provision_error: ~azure.mgmt.cosmosdb.models.CassandraError - :ivar extensions: Extensions to be added or updated on cluster. - :vartype extensions: list[str] - :ivar backup_schedules: List of backup schedules that define when you want to back up your - data. - :vartype backup_schedules: list[~azure.mgmt.cosmosdb.models.BackupSchedule] - :ivar scheduled_event_strategy: How the nodes in the cluster react to scheduled events. Known - values are: "Ignore", "StopAny", and "StopByRack". - :vartype scheduled_event_strategy: str or ~azure.mgmt.cosmosdb.models.ScheduledEventStrategy - :ivar azure_connection_method: How to connect to the azure services needed for running the - cluster. Known values are: "None" and "VPN". - :vartype azure_connection_method: str or ~azure.mgmt.cosmosdb.models.AzureConnectionType - :ivar private_link_resource_id: If the Connection Method is Vpn, this is the Id of the private - link resource that the datacenters need to connect to. - :vartype private_link_resource_id: str - """ - - _validation = { - "gossip_certificates": {"readonly": True}, - "seed_nodes": {"readonly": True}, - "private_link_resource_id": {"readonly": True}, - } - - _attribute_map = { - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "restore_from_backup_id": {"key": "restoreFromBackupId", "type": "str"}, - "delegated_management_subnet_id": {"key": "delegatedManagementSubnetId", "type": "str"}, - "cassandra_version": {"key": "cassandraVersion", "type": "str"}, - "cluster_name_override": {"key": "clusterNameOverride", "type": "str"}, - "authentication_method": {"key": "authenticationMethod", "type": "str"}, - "initial_cassandra_admin_password": {"key": "initialCassandraAdminPassword", "type": "str"}, - "prometheus_endpoint": {"key": "prometheusEndpoint", "type": "SeedNode"}, - "repair_enabled": {"key": "repairEnabled", "type": "bool"}, - "auto_replicate": {"key": "autoReplicate", "type": "str"}, - "client_certificates": {"key": "clientCertificates", "type": "[Certificate]"}, - "external_gossip_certificates": {"key": "externalGossipCertificates", "type": "[Certificate]"}, - "gossip_certificates": {"key": "gossipCertificates", "type": "[Certificate]"}, - "external_seed_nodes": {"key": "externalSeedNodes", "type": "[SeedNode]"}, - "seed_nodes": {"key": "seedNodes", "type": "[SeedNode]"}, - "external_data_centers": {"key": "externalDataCenters", "type": "[str]"}, - "hours_between_backups": {"key": "hoursBetweenBackups", "type": "int"}, - "deallocated": {"key": "deallocated", "type": "bool"}, - "cassandra_audit_logging_enabled": {"key": "cassandraAuditLoggingEnabled", "type": "bool"}, - "cluster_type": {"key": "clusterType", "type": "str"}, - "provision_error": {"key": "provisionError", "type": "CassandraError"}, - "extensions": {"key": "extensions", "type": "[str]"}, - "backup_schedules": {"key": "backupSchedules", "type": "[BackupSchedule]"}, - "scheduled_event_strategy": {"key": "scheduledEventStrategy", "type": "str"}, - "azure_connection_method": {"key": "azureConnectionMethod", "type": "str"}, - "private_link_resource_id": {"key": "privateLinkResourceId", "type": "str"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - provisioning_state: Optional[Union[str, "_models.ManagedCassandraProvisioningState"]] = None, - restore_from_backup_id: Optional[str] = None, - delegated_management_subnet_id: Optional[str] = None, - cassandra_version: Optional[str] = None, - cluster_name_override: Optional[str] = None, - authentication_method: Optional[Union[str, "_models.AuthenticationMethod"]] = None, - initial_cassandra_admin_password: Optional[str] = None, - prometheus_endpoint: Optional["_models.SeedNode"] = None, - repair_enabled: Optional[bool] = None, - auto_replicate: Optional[Union[str, "_models.AutoReplicate"]] = None, - client_certificates: Optional[List["_models.Certificate"]] = None, - external_gossip_certificates: Optional[List["_models.Certificate"]] = None, - external_seed_nodes: Optional[List["_models.SeedNode"]] = None, - external_data_centers: Optional[List[str]] = None, - hours_between_backups: Optional[int] = None, - deallocated: Optional[bool] = None, - cassandra_audit_logging_enabled: Optional[bool] = None, - cluster_type: Optional[Union[str, "_models.ClusterType"]] = None, - provision_error: Optional["_models.CassandraError"] = None, - extensions: Optional[List[str]] = None, - backup_schedules: Optional[List["_models.BackupSchedule"]] = None, - scheduled_event_strategy: Optional[Union[str, "_models.ScheduledEventStrategy"]] = None, - azure_connection_method: Optional[Union[str, "_models.AzureConnectionType"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword provisioning_state: The status of the resource at the time the operation was called. - Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and "Canceled". - :paramtype provisioning_state: str or - ~azure.mgmt.cosmosdb.models.ManagedCassandraProvisioningState - :keyword restore_from_backup_id: To create an empty cluster, omit this field or set it to null. - To restore a backup into a new cluster, set this field to the resource id of the backup. - :paramtype restore_from_backup_id: str - :keyword delegated_management_subnet_id: Resource id of a subnet that this cluster's management - service should have its network interface attached to. The subnet must be routable to all - subnets that will be delegated to data centers. The resource id must be of the form - '/subscriptions/:code:``/resourceGroups/:code:``/providers/Microsoft.Network/virtualNetworks/:code:``/subnets/:code:``'. - :paramtype delegated_management_subnet_id: str - :keyword cassandra_version: Which version of Cassandra should this cluster converge to running - (e.g., 3.11). When updated, the cluster may take some time to migrate to the new version. - :paramtype cassandra_version: str - :keyword cluster_name_override: If you need to set the clusterName property in cassandra.yaml - to something besides the resource name of the cluster, set the value to use on this property. - :paramtype cluster_name_override: str - :keyword authentication_method: Which authentication method Cassandra should use to - authenticate clients. 'None' turns off authentication, so should not be used except in - emergencies. 'Cassandra' is the default password based authentication. The default is - 'Cassandra'. Known values are: "None", "Cassandra", and "Ldap". - :paramtype authentication_method: str or ~azure.mgmt.cosmosdb.models.AuthenticationMethod - :keyword initial_cassandra_admin_password: Initial password for clients connecting as admin to - the cluster. Should be changed after cluster creation. Returns null on GET. This field only - applies when the authenticationMethod field is 'Cassandra'. - :paramtype initial_cassandra_admin_password: str - :keyword prometheus_endpoint: Hostname or IP address where the Prometheus endpoint containing - data about the managed Cassandra nodes can be reached. - :paramtype prometheus_endpoint: ~azure.mgmt.cosmosdb.models.SeedNode - :keyword repair_enabled: Should automatic repairs run on this cluster? If omitted, this is - true, and should stay true unless you are running a hybrid cluster where you are already doing - your own repairs. - :paramtype repair_enabled: bool - :keyword auto_replicate: The form of AutoReplicate that is being used by this cluster. Known - values are: "None", "SystemKeyspaces", and "AllKeyspaces". - :paramtype auto_replicate: str or ~azure.mgmt.cosmosdb.models.AutoReplicate - :keyword client_certificates: List of TLS certificates used to authorize clients connecting to - the cluster. All connections are TLS encrypted whether clientCertificates is set or not, but if - clientCertificates is set, the managed Cassandra cluster will reject all connections not - bearing a TLS client certificate that can be validated from one or more of the public - certificates in this property. - :paramtype client_certificates: list[~azure.mgmt.cosmosdb.models.Certificate] - :keyword external_gossip_certificates: List of TLS certificates used to authorize gossip from - unmanaged data centers. The TLS certificates of all nodes in unmanaged data centers must be - verifiable using one of the certificates provided in this property. - :paramtype external_gossip_certificates: list[~azure.mgmt.cosmosdb.models.Certificate] - :keyword external_seed_nodes: List of IP addresses of seed nodes in unmanaged data centers. - These will be added to the seed node lists of all managed nodes. - :paramtype external_seed_nodes: list[~azure.mgmt.cosmosdb.models.SeedNode] - :keyword external_data_centers: List of the data center names for unmanaged data centers in - this cluster to be included in auto-replication. - :paramtype external_data_centers: list[str] - :keyword hours_between_backups: (Deprecated) Number of hours to wait between taking a backup of - the cluster. - :paramtype hours_between_backups: int - :keyword deallocated: Whether the cluster and associated data centers has been deallocated. - :paramtype deallocated: bool - :keyword cassandra_audit_logging_enabled: Whether Cassandra audit logging is enabled. - :paramtype cassandra_audit_logging_enabled: bool - :keyword cluster_type: Type of the cluster. If set to Production, some operations might not be - permitted on cluster. Known values are: "Production" and "NonProduction". - :paramtype cluster_type: str or ~azure.mgmt.cosmosdb.models.ClusterType - :keyword provision_error: Error related to resource provisioning. - :paramtype provision_error: ~azure.mgmt.cosmosdb.models.CassandraError - :keyword extensions: Extensions to be added or updated on cluster. - :paramtype extensions: list[str] - :keyword backup_schedules: List of backup schedules that define when you want to back up your - data. - :paramtype backup_schedules: list[~azure.mgmt.cosmosdb.models.BackupSchedule] - :keyword scheduled_event_strategy: How the nodes in the cluster react to scheduled events. - Known values are: "Ignore", "StopAny", and "StopByRack". - :paramtype scheduled_event_strategy: str or ~azure.mgmt.cosmosdb.models.ScheduledEventStrategy - :keyword azure_connection_method: How to connect to the azure services needed for running the - cluster. Known values are: "None" and "VPN". - :paramtype azure_connection_method: str or ~azure.mgmt.cosmosdb.models.AzureConnectionType - """ - super().__init__(**kwargs) - self.provisioning_state = provisioning_state - self.restore_from_backup_id = restore_from_backup_id - self.delegated_management_subnet_id = delegated_management_subnet_id - self.cassandra_version = cassandra_version - self.cluster_name_override = cluster_name_override - self.authentication_method = authentication_method - self.initial_cassandra_admin_password = initial_cassandra_admin_password - self.prometheus_endpoint = prometheus_endpoint - self.repair_enabled = repair_enabled - self.auto_replicate = auto_replicate - self.client_certificates = client_certificates - self.external_gossip_certificates = external_gossip_certificates - self.gossip_certificates = None - self.external_seed_nodes = external_seed_nodes - self.seed_nodes = None - self.external_data_centers = external_data_centers - self.hours_between_backups = hours_between_backups - self.deallocated = deallocated - self.cassandra_audit_logging_enabled = cassandra_audit_logging_enabled - self.cluster_type = cluster_type - self.provision_error = provision_error - self.extensions = extensions - self.backup_schedules = backup_schedules - self.scheduled_event_strategy = scheduled_event_strategy - self.azure_connection_method = azure_connection_method - self.private_link_resource_id = None - - -class Column(_serialization.Model): - """Cosmos DB Cassandra table column. - - :ivar name: Name of the Cosmos DB Cassandra table column. - :vartype name: str - :ivar type: Type of the Cosmos DB Cassandra table column. - :vartype type: str - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__(self, *, name: Optional[str] = None, type: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword name: Name of the Cosmos DB Cassandra table column. - :paramtype name: str - :keyword type: Type of the Cosmos DB Cassandra table column. - :paramtype type: str - """ - super().__init__(**kwargs) - self.name = name - self.type = type - - -class CommandAsyncPostBody(_serialization.Model): - """Specification of which command to run where. - - All required parameters must be populated in order to send to server. - - :ivar command: The command which should be run. Required. - :vartype command: str - :ivar arguments: The arguments for the command to be run. - :vartype arguments: JSON - :ivar host: IP address of the cassandra host to run the command on. Required. - :vartype host: str - :ivar cassandra_stop_start: If true, stops cassandra before executing the command and then - start it again. - :vartype cassandra_stop_start: bool - :ivar read_write: If true, allows the command to *write* to the cassandra directory, otherwise - read-only. - :vartype read_write: bool - """ - - _validation = { - "command": {"required": True}, - "host": {"required": True}, - } - - _attribute_map = { - "command": {"key": "command", "type": "str"}, - "arguments": {"key": "arguments", "type": "object"}, - "host": {"key": "host", "type": "str"}, - "cassandra_stop_start": {"key": "cassandra-stop-start", "type": "bool"}, - "read_write": {"key": "readWrite", "type": "bool"}, - } - - def __init__( - self, - *, - command: str, - host: str, - arguments: Optional[JSON] = None, - cassandra_stop_start: Optional[bool] = None, - read_write: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword command: The command which should be run. Required. - :paramtype command: str - :keyword arguments: The arguments for the command to be run. - :paramtype arguments: JSON - :keyword host: IP address of the cassandra host to run the command on. Required. - :paramtype host: str - :keyword cassandra_stop_start: If true, stops cassandra before executing the command and then - start it again. - :paramtype cassandra_stop_start: bool - :keyword read_write: If true, allows the command to *write* to the cassandra directory, - otherwise read-only. - :paramtype read_write: bool - """ - super().__init__(**kwargs) - self.command = command - self.arguments = arguments - self.host = host - self.cassandra_stop_start = cassandra_stop_start - self.read_write = read_write - - -class CommandOutput(_serialization.Model): - """Response of /command api. - - :ivar command_output: Output of the command. - :vartype command_output: str - """ - - _attribute_map = { - "command_output": {"key": "commandOutput", "type": "str"}, - } - - def __init__(self, *, command_output: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword command_output: Output of the command. - :paramtype command_output: str - """ - super().__init__(**kwargs) - self.command_output = command_output - - -class CommandPostBody(_serialization.Model): - """Specification of which command to run where. - - All required parameters must be populated in order to send to server. - - :ivar command: The command which should be run. Required. - :vartype command: str - :ivar arguments: The arguments for the command to be run. - :vartype arguments: dict[str, str] - :ivar host: IP address of the cassandra host to run the command on. Required. - :vartype host: str - :ivar cassandra_stop_start: If true, stops cassandra before executing the command and then - start it again. - :vartype cassandra_stop_start: bool - :ivar readwrite: If true, allows the command to *write* to the cassandra directory, otherwise - read-only. - :vartype readwrite: bool - """ - - _validation = { - "command": {"required": True}, - "host": {"required": True}, - } - - _attribute_map = { - "command": {"key": "command", "type": "str"}, - "arguments": {"key": "arguments", "type": "{str}"}, - "host": {"key": "host", "type": "str"}, - "cassandra_stop_start": {"key": "cassandra-stop-start", "type": "bool"}, - "readwrite": {"key": "readwrite", "type": "bool"}, - } - - def __init__( - self, - *, - command: str, - host: str, - arguments: Optional[Dict[str, str]] = None, - cassandra_stop_start: Optional[bool] = None, - readwrite: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword command: The command which should be run. Required. - :paramtype command: str - :keyword arguments: The arguments for the command to be run. - :paramtype arguments: dict[str, str] - :keyword host: IP address of the cassandra host to run the command on. Required. - :paramtype host: str - :keyword cassandra_stop_start: If true, stops cassandra before executing the command and then - start it again. - :paramtype cassandra_stop_start: bool - :keyword readwrite: If true, allows the command to *write* to the cassandra directory, - otherwise read-only. - :paramtype readwrite: bool - """ - super().__init__(**kwargs) - self.command = command - self.arguments = arguments - self.host = host - self.cassandra_stop_start = cassandra_stop_start - self.readwrite = readwrite - - -class CommandPublicResource(_serialization.Model): - """resource representing a command. - - :ivar command: The command which should be run. - :vartype command: str - :ivar command_id: The unique id of command. - :vartype command_id: str - :ivar arguments: The arguments for the command to be run. - :vartype arguments: JSON - :ivar host: IP address of the cassandra host to run the command on. - :vartype host: str - :ivar is_admin: Whether command has admin privileges. - :vartype is_admin: bool - :ivar cassandra_stop_start: If true, stops cassandra before executing the command and then - start it again. - :vartype cassandra_stop_start: bool - :ivar read_write: If true, allows the command to *write* to the cassandra directory, otherwise - read-only. - :vartype read_write: bool - :ivar result: Result output of the command. - :vartype result: str - :ivar status: Status of the command. Known values are: "Done", "Running", "Enqueue", - "Processing", "Finished", and "Failed". - :vartype status: str or ~azure.mgmt.cosmosdb.models.CommandStatus - :ivar output_file: The name of the file where the result is written. - :vartype output_file: str - """ - - _attribute_map = { - "command": {"key": "command", "type": "str"}, - "command_id": {"key": "commandId", "type": "str"}, - "arguments": {"key": "arguments", "type": "object"}, - "host": {"key": "host", "type": "str"}, - "is_admin": {"key": "isAdmin", "type": "bool"}, - "cassandra_stop_start": {"key": "cassandraStopStart", "type": "bool"}, - "read_write": {"key": "readWrite", "type": "bool"}, - "result": {"key": "result", "type": "str"}, - "status": {"key": "status", "type": "str"}, - "output_file": {"key": "outputFile", "type": "str"}, - } - - def __init__( - self, - *, - command: Optional[str] = None, - command_id: Optional[str] = None, - arguments: Optional[JSON] = None, - host: Optional[str] = None, - is_admin: Optional[bool] = None, - cassandra_stop_start: Optional[bool] = None, - read_write: Optional[bool] = None, - result: Optional[str] = None, - status: Optional[Union[str, "_models.CommandStatus"]] = None, - output_file: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword command: The command which should be run. - :paramtype command: str - :keyword command_id: The unique id of command. - :paramtype command_id: str - :keyword arguments: The arguments for the command to be run. - :paramtype arguments: JSON - :keyword host: IP address of the cassandra host to run the command on. - :paramtype host: str - :keyword is_admin: Whether command has admin privileges. - :paramtype is_admin: bool - :keyword cassandra_stop_start: If true, stops cassandra before executing the command and then - start it again. - :paramtype cassandra_stop_start: bool - :keyword read_write: If true, allows the command to *write* to the cassandra directory, - otherwise read-only. - :paramtype read_write: bool - :keyword result: Result output of the command. - :paramtype result: str - :keyword status: Status of the command. Known values are: "Done", "Running", "Enqueue", - "Processing", "Finished", and "Failed". - :paramtype status: str or ~azure.mgmt.cosmosdb.models.CommandStatus - :keyword output_file: The name of the file where the result is written. - :paramtype output_file: str - """ - super().__init__(**kwargs) - self.command = command - self.command_id = command_id - self.arguments = arguments - self.host = host - self.is_admin = is_admin - self.cassandra_stop_start = cassandra_stop_start - self.read_write = read_write - self.result = result - self.status = status - self.output_file = output_file - - -class CompositePath(_serialization.Model): - """CompositePath. - - :ivar path: The path for which the indexing behavior applies to. Index paths typically start - with root and end with wildcard (/path/*). - :vartype path: str - :ivar order: Sort order for composite paths. Known values are: "ascending" and "descending". - :vartype order: str or ~azure.mgmt.cosmosdb.models.CompositePathSortOrder - """ - - _attribute_map = { - "path": {"key": "path", "type": "str"}, - "order": {"key": "order", "type": "str"}, - } - - def __init__( - self, - *, - path: Optional[str] = None, - order: Optional[Union[str, "_models.CompositePathSortOrder"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword path: The path for which the indexing behavior applies to. Index paths typically start - with root and end with wildcard (/path/*). - :paramtype path: str - :keyword order: Sort order for composite paths. Known values are: "ascending" and "descending". - :paramtype order: str or ~azure.mgmt.cosmosdb.models.CompositePathSortOrder - """ - super().__init__(**kwargs) - self.path = path - self.order = order - - -class ComputedProperty(_serialization.Model): - """The definition of a computed property. - - :ivar name: The name of a computed property, for example - "cp_lowerName". - :vartype name: str - :ivar query: The query that evaluates the value for computed property, for example - "SELECT - VALUE LOWER(c.name) FROM c". - :vartype query: str - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "query": {"key": "query", "type": "str"}, - } - - def __init__(self, *, name: Optional[str] = None, query: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword name: The name of a computed property, for example - "cp_lowerName". - :paramtype name: str - :keyword query: The query that evaluates the value for computed property, for example - "SELECT - VALUE LOWER(c.name) FROM c". - :paramtype query: str - """ - super().__init__(**kwargs) - self.name = name - self.query = query - - -class ConflictResolutionPolicy(_serialization.Model): - """The conflict resolution policy for the container. - - :ivar mode: Indicates the conflict resolution mode. Known values are: "LastWriterWins" and - "Custom". - :vartype mode: str or ~azure.mgmt.cosmosdb.models.ConflictResolutionMode - :ivar conflict_resolution_path: The conflict resolution path in the case of LastWriterWins - mode. - :vartype conflict_resolution_path: str - :ivar conflict_resolution_procedure: The procedure to resolve conflicts in the case of custom - mode. - :vartype conflict_resolution_procedure: str - """ - - _attribute_map = { - "mode": {"key": "mode", "type": "str"}, - "conflict_resolution_path": {"key": "conflictResolutionPath", "type": "str"}, - "conflict_resolution_procedure": {"key": "conflictResolutionProcedure", "type": "str"}, - } - - def __init__( - self, - *, - mode: Union[str, "_models.ConflictResolutionMode"] = "LastWriterWins", - conflict_resolution_path: Optional[str] = None, - conflict_resolution_procedure: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword mode: Indicates the conflict resolution mode. Known values are: "LastWriterWins" and - "Custom". - :paramtype mode: str or ~azure.mgmt.cosmosdb.models.ConflictResolutionMode - :keyword conflict_resolution_path: The conflict resolution path in the case of LastWriterWins - mode. - :paramtype conflict_resolution_path: str - :keyword conflict_resolution_procedure: The procedure to resolve conflicts in the case of - custom mode. - :paramtype conflict_resolution_procedure: str - """ - super().__init__(**kwargs) - self.mode = mode - self.conflict_resolution_path = conflict_resolution_path - self.conflict_resolution_procedure = conflict_resolution_procedure - - -class ConnectionError(_serialization.Model): - """ConnectionError. - - :ivar connection_state: The kind of connection error that occurred. Known values are: - "Unknown", "OK", "OperatorToDataCenterNetworkError", "DatacenterToDatacenterNetworkError", - "InternalOperatorToDataCenterCertificateError", and "InternalError". - :vartype connection_state: str or ~azure.mgmt.cosmosdb.models.ConnectionState - :ivar i_p_from: The IP of host that originated the failed connection. - :vartype i_p_from: str - :ivar i_p_to: The IP that the connection attempted to reach. - :vartype i_p_to: str - :ivar port: The TCP port the connection was attempted on. - :vartype port: int - :ivar exception: Detailed error message about the failed connection. - :vartype exception: str - """ - - _attribute_map = { - "connection_state": {"key": "connectionState", "type": "str"}, - "i_p_from": {"key": "iPFrom", "type": "str"}, - "i_p_to": {"key": "iPTo", "type": "str"}, - "port": {"key": "port", "type": "int"}, - "exception": {"key": "exception", "type": "str"}, - } - - def __init__( - self, - *, - connection_state: Optional[Union[str, "_models.ConnectionState"]] = None, - i_p_from: Optional[str] = None, - i_p_to: Optional[str] = None, - port: Optional[int] = None, - exception: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword connection_state: The kind of connection error that occurred. Known values are: - "Unknown", "OK", "OperatorToDataCenterNetworkError", "DatacenterToDatacenterNetworkError", - "InternalOperatorToDataCenterCertificateError", and "InternalError". - :paramtype connection_state: str or ~azure.mgmt.cosmosdb.models.ConnectionState - :keyword i_p_from: The IP of host that originated the failed connection. - :paramtype i_p_from: str - :keyword i_p_to: The IP that the connection attempted to reach. - :paramtype i_p_to: str - :keyword port: The TCP port the connection was attempted on. - :paramtype port: int - :keyword exception: Detailed error message about the failed connection. - :paramtype exception: str - """ - super().__init__(**kwargs) - self.connection_state = connection_state - self.i_p_from = i_p_from - self.i_p_to = i_p_to - self.port = port - self.exception = exception - - -class ConsistencyPolicy(_serialization.Model): - """The consistency policy for the Cosmos DB database account. - - All required parameters must be populated in order to send to server. - - :ivar default_consistency_level: The default consistency level and configuration settings of - the Cosmos DB account. Required. Known values are: "Eventual", "Session", "BoundedStaleness", - "Strong", and "ConsistentPrefix". - :vartype default_consistency_level: str or ~azure.mgmt.cosmosdb.models.DefaultConsistencyLevel - :ivar max_staleness_prefix: When used with the Bounded Staleness consistency level, this value - represents the number of stale requests tolerated. Accepted range for this value is 1 – - 2,147,483,647. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. - :vartype max_staleness_prefix: int - :ivar max_interval_in_seconds: When used with the Bounded Staleness consistency level, this - value represents the time amount of staleness (in seconds) tolerated. Accepted range for this - value is 5 - 86400. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. - :vartype max_interval_in_seconds: int - """ - - _validation = { - "default_consistency_level": {"required": True}, - "max_staleness_prefix": {"maximum": 2147483647, "minimum": 1}, - "max_interval_in_seconds": {"maximum": 86400, "minimum": 5}, - } - - _attribute_map = { - "default_consistency_level": {"key": "defaultConsistencyLevel", "type": "str"}, - "max_staleness_prefix": {"key": "maxStalenessPrefix", "type": "int"}, - "max_interval_in_seconds": {"key": "maxIntervalInSeconds", "type": "int"}, - } - - def __init__( - self, - *, - default_consistency_level: Union[str, "_models.DefaultConsistencyLevel"], - max_staleness_prefix: Optional[int] = None, - max_interval_in_seconds: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword default_consistency_level: The default consistency level and configuration settings of - the Cosmos DB account. Required. Known values are: "Eventual", "Session", "BoundedStaleness", - "Strong", and "ConsistentPrefix". - :paramtype default_consistency_level: str or - ~azure.mgmt.cosmosdb.models.DefaultConsistencyLevel - :keyword max_staleness_prefix: When used with the Bounded Staleness consistency level, this - value represents the number of stale requests tolerated. Accepted range for this value is 1 – - 2,147,483,647. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. - :paramtype max_staleness_prefix: int - :keyword max_interval_in_seconds: When used with the Bounded Staleness consistency level, this - value represents the time amount of staleness (in seconds) tolerated. Accepted range for this - value is 5 - 86400. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. - :paramtype max_interval_in_seconds: int - """ - super().__init__(**kwargs) - self.default_consistency_level = default_consistency_level - self.max_staleness_prefix = max_staleness_prefix - self.max_interval_in_seconds = max_interval_in_seconds - - -class ContainerPartitionKey(_serialization.Model): - """The configuration of the partition key to be used for partitioning data into multiple - partitions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar paths: List of paths using which data within the container can be partitioned. - :vartype paths: list[str] - :ivar kind: Indicates the kind of algorithm used for partitioning. For MultiHash, multiple - partition keys (upto three maximum) are supported for container create. Known values are: - "Hash", "Range", and "MultiHash". - :vartype kind: str or ~azure.mgmt.cosmosdb.models.PartitionKind - :ivar version: Indicates the version of the partition key definition. - :vartype version: int - :ivar system_key: Indicates if the container is using a system generated partition key. - :vartype system_key: bool - """ - - _validation = { - "version": {"maximum": 2, "minimum": 1}, - "system_key": {"readonly": True}, - } - - _attribute_map = { - "paths": {"key": "paths", "type": "[str]"}, - "kind": {"key": "kind", "type": "str"}, - "version": {"key": "version", "type": "int"}, - "system_key": {"key": "systemKey", "type": "bool"}, - } - - def __init__( - self, - *, - paths: Optional[List[str]] = None, - kind: Union[str, "_models.PartitionKind"] = "Hash", - version: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword paths: List of paths using which data within the container can be partitioned. - :paramtype paths: list[str] - :keyword kind: Indicates the kind of algorithm used for partitioning. For MultiHash, multiple - partition keys (upto three maximum) are supported for container create. Known values are: - "Hash", "Range", and "MultiHash". - :paramtype kind: str or ~azure.mgmt.cosmosdb.models.PartitionKind - :keyword version: Indicates the version of the partition key definition. - :paramtype version: int - """ - super().__init__(**kwargs) - self.paths = paths - self.kind = kind - self.version = version - self.system_key = None - - -class ContinuousBackupInformation(_serialization.Model): - """Information about the status of continuous backups. - - :ivar latest_restorable_timestamp: The latest restorable timestamp for a resource. - :vartype latest_restorable_timestamp: str - """ - - _attribute_map = { - "latest_restorable_timestamp": {"key": "latestRestorableTimestamp", "type": "str"}, - } - - def __init__(self, *, latest_restorable_timestamp: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword latest_restorable_timestamp: The latest restorable timestamp for a resource. - :paramtype latest_restorable_timestamp: str - """ - super().__init__(**kwargs) - self.latest_restorable_timestamp = latest_restorable_timestamp - - -class ContinuousBackupRestoreLocation(_serialization.Model): - """Properties of the regional restorable account. - - :ivar location: The name of the continuous backup restore location. - :vartype location: str - """ - - _attribute_map = { - "location": {"key": "location", "type": "str"}, - } - - def __init__(self, *, location: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword location: The name of the continuous backup restore location. - :paramtype location: str - """ - super().__init__(**kwargs) - self.location = location - - -class ContinuousModeBackupPolicy(BackupPolicy): - """The object representing continuous mode backup policy. - - All required parameters must be populated in order to send to server. - - :ivar type: Describes the mode of backups. Required. Known values are: "Periodic" and - "Continuous". - :vartype type: str or ~azure.mgmt.cosmosdb.models.BackupPolicyType - :ivar migration_state: The object representing the state of the migration between the backup - policies. - :vartype migration_state: ~azure.mgmt.cosmosdb.models.BackupPolicyMigrationState - :ivar continuous_mode_properties: Configuration values for continuous mode backup. - :vartype continuous_mode_properties: ~azure.mgmt.cosmosdb.models.ContinuousModeProperties - """ - - _validation = { - "type": {"required": True}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "migration_state": {"key": "migrationState", "type": "BackupPolicyMigrationState"}, - "continuous_mode_properties": {"key": "continuousModeProperties", "type": "ContinuousModeProperties"}, - } - - def __init__( - self, - *, - migration_state: Optional["_models.BackupPolicyMigrationState"] = None, - continuous_mode_properties: Optional["_models.ContinuousModeProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword migration_state: The object representing the state of the migration between the backup - policies. - :paramtype migration_state: ~azure.mgmt.cosmosdb.models.BackupPolicyMigrationState - :keyword continuous_mode_properties: Configuration values for continuous mode backup. - :paramtype continuous_mode_properties: ~azure.mgmt.cosmosdb.models.ContinuousModeProperties - """ - super().__init__(migration_state=migration_state, **kwargs) - self.type: str = "Continuous" - self.continuous_mode_properties = continuous_mode_properties - - -class ContinuousModeProperties(_serialization.Model): - """Configuration values for periodic mode backup. - - :ivar tier: Enum to indicate type of Continuos backup mode. Known values are: "Continuous7Days" - and "Continuous30Days". - :vartype tier: str or ~azure.mgmt.cosmosdb.models.ContinuousTier - """ - - _attribute_map = { - "tier": {"key": "tier", "type": "str"}, - } - - def __init__(self, *, tier: Optional[Union[str, "_models.ContinuousTier"]] = None, **kwargs: Any) -> None: - """ - :keyword tier: Enum to indicate type of Continuos backup mode. Known values are: - "Continuous7Days" and "Continuous30Days". - :paramtype tier: str or ~azure.mgmt.cosmosdb.models.ContinuousTier - """ - super().__init__(**kwargs) - self.tier = tier - - -class CorsPolicy(_serialization.Model): - """The CORS policy for the Cosmos DB database account. - - All required parameters must be populated in order to send to server. - - :ivar allowed_origins: The origin domains that are permitted to make a request against the - service via CORS. Required. - :vartype allowed_origins: str - :ivar allowed_methods: The methods (HTTP request verbs) that the origin domain may use for a - CORS request. - :vartype allowed_methods: str - :ivar allowed_headers: The request headers that the origin domain may specify on the CORS - request. - :vartype allowed_headers: str - :ivar exposed_headers: The response headers that may be sent in the response to the CORS - request and exposed by the browser to the request issuer. - :vartype exposed_headers: str - :ivar max_age_in_seconds: The maximum amount time that a browser should cache the preflight - OPTIONS request. - :vartype max_age_in_seconds: int - """ - - _validation = { - "allowed_origins": {"required": True}, - "max_age_in_seconds": {"maximum": 2147483647, "minimum": 1}, - } - - _attribute_map = { - "allowed_origins": {"key": "allowedOrigins", "type": "str"}, - "allowed_methods": {"key": "allowedMethods", "type": "str"}, - "allowed_headers": {"key": "allowedHeaders", "type": "str"}, - "exposed_headers": {"key": "exposedHeaders", "type": "str"}, - "max_age_in_seconds": {"key": "maxAgeInSeconds", "type": "int"}, - } - - def __init__( - self, - *, - allowed_origins: str, - allowed_methods: Optional[str] = None, - allowed_headers: Optional[str] = None, - exposed_headers: Optional[str] = None, - max_age_in_seconds: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword allowed_origins: The origin domains that are permitted to make a request against the - service via CORS. Required. - :paramtype allowed_origins: str - :keyword allowed_methods: The methods (HTTP request verbs) that the origin domain may use for a - CORS request. - :paramtype allowed_methods: str - :keyword allowed_headers: The request headers that the origin domain may specify on the CORS - request. - :paramtype allowed_headers: str - :keyword exposed_headers: The response headers that may be sent in the response to the CORS - request and exposed by the browser to the request issuer. - :paramtype exposed_headers: str - :keyword max_age_in_seconds: The maximum amount time that a browser should cache the preflight - OPTIONS request. - :paramtype max_age_in_seconds: int - """ - super().__init__(**kwargs) - self.allowed_origins = allowed_origins - self.allowed_methods = allowed_methods - self.allowed_headers = allowed_headers - self.exposed_headers = exposed_headers - self.max_age_in_seconds = max_age_in_seconds - - -class CosmosCassandraDataTransferDataSourceSink(BaseCosmosDataTransferDataSourceSink): # pylint: disable=name-too-long - """A CosmosDB Cassandra API data source/sink. - - All required parameters must be populated in order to send to server. - - :ivar component: Known values are: "CosmosDBCassandra", "CosmosDBMongo", "CosmosDBMongoVCore", - "CosmosDBSql", and "AzureBlobStorage". - :vartype component: str or ~azure.mgmt.cosmosdb.models.DataTransferComponent - :ivar remote_account_name: - :vartype remote_account_name: str - :ivar keyspace_name: Required. - :vartype keyspace_name: str - :ivar table_name: Required. - :vartype table_name: str - """ - - _validation = { - "component": {"required": True}, - "keyspace_name": {"required": True}, - "table_name": {"required": True}, - } - - _attribute_map = { - "component": {"key": "component", "type": "str"}, - "remote_account_name": {"key": "remoteAccountName", "type": "str"}, - "keyspace_name": {"key": "keyspaceName", "type": "str"}, - "table_name": {"key": "tableName", "type": "str"}, - } - - def __init__( - self, *, keyspace_name: str, table_name: str, remote_account_name: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword remote_account_name: - :paramtype remote_account_name: str - :keyword keyspace_name: Required. - :paramtype keyspace_name: str - :keyword table_name: Required. - :paramtype table_name: str - """ - super().__init__(remote_account_name=remote_account_name, **kwargs) - self.component: str = "CosmosDBCassandra" - self.keyspace_name = keyspace_name - self.table_name = table_name - - -class CosmosMongoDataTransferDataSourceSink(BaseCosmosDataTransferDataSourceSink): - """A CosmosDB Mongo API data source/sink. - - All required parameters must be populated in order to send to server. - - :ivar component: Known values are: "CosmosDBCassandra", "CosmosDBMongo", "CosmosDBMongoVCore", - "CosmosDBSql", and "AzureBlobStorage". - :vartype component: str or ~azure.mgmt.cosmosdb.models.DataTransferComponent - :ivar remote_account_name: - :vartype remote_account_name: str - :ivar database_name: Required. - :vartype database_name: str - :ivar collection_name: Required. - :vartype collection_name: str - """ - - _validation = { - "component": {"required": True}, - "database_name": {"required": True}, - "collection_name": {"required": True}, - } - - _attribute_map = { - "component": {"key": "component", "type": "str"}, - "remote_account_name": {"key": "remoteAccountName", "type": "str"}, - "database_name": {"key": "databaseName", "type": "str"}, - "collection_name": {"key": "collectionName", "type": "str"}, - } - - def __init__( - self, *, database_name: str, collection_name: str, remote_account_name: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword remote_account_name: - :paramtype remote_account_name: str - :keyword database_name: Required. - :paramtype database_name: str - :keyword collection_name: Required. - :paramtype collection_name: str - """ - super().__init__(remote_account_name=remote_account_name, **kwargs) - self.component: str = "CosmosDBMongo" - self.database_name = database_name - self.collection_name = collection_name - - -class CosmosMongoVCoreDataTransferDataSourceSink(DataTransferDataSourceSink): # pylint: disable=name-too-long - """A CosmosDB Mongo vCore API data source/sink. - - All required parameters must be populated in order to send to server. - - :ivar component: Known values are: "CosmosDBCassandra", "CosmosDBMongo", "CosmosDBMongoVCore", - "CosmosDBSql", and "AzureBlobStorage". - :vartype component: str or ~azure.mgmt.cosmosdb.models.DataTransferComponent - :ivar database_name: Required. - :vartype database_name: str - :ivar collection_name: Required. - :vartype collection_name: str - :ivar host_name: - :vartype host_name: str - :ivar connection_string_key_vault_uri: - :vartype connection_string_key_vault_uri: str - """ - - _validation = { - "component": {"required": True}, - "database_name": {"required": True}, - "collection_name": {"required": True}, - } - - _attribute_map = { - "component": {"key": "component", "type": "str"}, - "database_name": {"key": "databaseName", "type": "str"}, - "collection_name": {"key": "collectionName", "type": "str"}, - "host_name": {"key": "hostName", "type": "str"}, - "connection_string_key_vault_uri": {"key": "connectionStringKeyVaultUri", "type": "str"}, - } - - def __init__( - self, - *, - database_name: str, - collection_name: str, - host_name: Optional[str] = None, - connection_string_key_vault_uri: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword database_name: Required. - :paramtype database_name: str - :keyword collection_name: Required. - :paramtype collection_name: str - :keyword host_name: - :paramtype host_name: str - :keyword connection_string_key_vault_uri: - :paramtype connection_string_key_vault_uri: str - """ - super().__init__(**kwargs) - self.component: str = "CosmosDBMongoVCore" - self.database_name = database_name - self.collection_name = collection_name - self.host_name = host_name - self.connection_string_key_vault_uri = connection_string_key_vault_uri - - -class CosmosSqlDataTransferDataSourceSink(BaseCosmosDataTransferDataSourceSink): - """A CosmosDB No Sql API data source/sink. - - All required parameters must be populated in order to send to server. - - :ivar component: Known values are: "CosmosDBCassandra", "CosmosDBMongo", "CosmosDBMongoVCore", - "CosmosDBSql", and "AzureBlobStorage". - :vartype component: str or ~azure.mgmt.cosmosdb.models.DataTransferComponent - :ivar remote_account_name: - :vartype remote_account_name: str - :ivar database_name: Required. - :vartype database_name: str - :ivar container_name: Required. - :vartype container_name: str - """ - - _validation = { - "component": {"required": True}, - "database_name": {"required": True}, - "container_name": {"required": True}, - } - - _attribute_map = { - "component": {"key": "component", "type": "str"}, - "remote_account_name": {"key": "remoteAccountName", "type": "str"}, - "database_name": {"key": "databaseName", "type": "str"}, - "container_name": {"key": "containerName", "type": "str"}, - } - - def __init__( - self, *, database_name: str, container_name: str, remote_account_name: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword remote_account_name: - :paramtype remote_account_name: str - :keyword database_name: Required. - :paramtype database_name: str - :keyword container_name: Required. - :paramtype container_name: str - """ - super().__init__(remote_account_name=remote_account_name, **kwargs) - self.component: str = "CosmosDBSql" - self.database_name = database_name - self.container_name = container_name - - -class CreateJobRequest(ARMProxyResource): - """Parameters to create Data Transfer Job. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: The unique resource identifier of the database account. - :vartype id: str - :ivar name: The name of the database account. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar properties: Data Transfer Create Job Properties. Required. - :vartype properties: ~azure.mgmt.cosmosdb.models.DataTransferJobProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "properties": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "properties": {"key": "properties", "type": "DataTransferJobProperties"}, - } - - def __init__(self, *, properties: "_models.DataTransferJobProperties", **kwargs: Any) -> None: - """ - :keyword properties: Data Transfer Create Job Properties. Required. - :paramtype properties: ~azure.mgmt.cosmosdb.models.DataTransferJobProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class CreateUpdateOptions(_serialization.Model): - """CreateUpdateOptions are a list of key-value pairs that describe the resource. Supported keys - are "If-Match", "If-None-Match", "Session-Token" and "Throughput". - - :ivar throughput: Request Units per second. For example, "throughput": 10000. - :vartype throughput: int - :ivar autoscale_settings: Specifies the Autoscale settings. Note: Either throughput or - autoscaleSettings is required, but not both. - :vartype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings - """ - - _attribute_map = { - "throughput": {"key": "throughput", "type": "int"}, - "autoscale_settings": {"key": "autoscaleSettings", "type": "AutoscaleSettings"}, - } - - def __init__( - self, - *, - throughput: Optional[int] = None, - autoscale_settings: Optional["_models.AutoscaleSettings"] = None, - **kwargs: Any - ) -> None: - """ - :keyword throughput: Request Units per second. For example, "throughput": 10000. - :paramtype throughput: int - :keyword autoscale_settings: Specifies the Autoscale settings. Note: Either throughput or - autoscaleSettings is required, but not both. - :paramtype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings - """ - super().__init__(**kwargs) - self.throughput = throughput - self.autoscale_settings = autoscale_settings - - -class DatabaseAccountConnectionString(_serialization.Model): - """Connection string for the Cosmos DB account. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar connection_string: Value of the connection string. - :vartype connection_string: str - :ivar description: Description of the connection string. - :vartype description: str - :ivar key_kind: Kind of the connection string key. Known values are: "Primary", "Secondary", - "PrimaryReadonly", and "SecondaryReadonly". - :vartype key_kind: str or ~azure.mgmt.cosmosdb.models.Kind - :ivar type: Type of the connection string. Known values are: "Sql", "Table", "MongoDB", - "Cassandra", "CassandraConnectorMetadata", "Gremlin", "SqlDedicatedGateway", "GremlinV2", and - "Undefined". - :vartype type: str or ~azure.mgmt.cosmosdb.models.Type - """ - - _validation = { - "connection_string": {"readonly": True}, - "description": {"readonly": True}, - "key_kind": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "connection_string": {"key": "connectionString", "type": "str"}, - "description": {"key": "description", "type": "str"}, - "key_kind": {"key": "keyKind", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.connection_string = None - self.description = None - self.key_kind = None - self.type = None - - -class DatabaseAccountCreateUpdateParameters(ARMResourceProperties): - """Parameters to create and update Cosmos DB database accounts. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar location: The location of the resource group to which the resource belongs. - :vartype location: str - :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :ivar kind: Indicates the type of database account. This can only be set at database account - creation. Known values are: "GlobalDocumentDB", "MongoDB", and "Parse". - :vartype kind: str or ~azure.mgmt.cosmosdb.models.DatabaseAccountKind - :ivar consistency_policy: The consistency policy for the Cosmos DB account. - :vartype consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy - :ivar locations: An array that contains the georeplication locations enabled for the Cosmos DB - account. Required. - :vartype locations: list[~azure.mgmt.cosmosdb.models.Location] - :ivar database_account_offer_type: The offer type for the database. Required. Default value is - "Standard". - :vartype database_account_offer_type: str - :ivar ip_rules: List of IpRules. - :vartype ip_rules: list[~azure.mgmt.cosmosdb.models.IpAddressOrRange] - :ivar is_virtual_network_filter_enabled: Flag to indicate whether to enable/disable Virtual - Network ACL rules. - :vartype is_virtual_network_filter_enabled: bool - :ivar enable_automatic_failover: Enables automatic failover of the write region in the rare - event that the region is unavailable due to an outage. Automatic failover will result in a new - write region for the account and is chosen based on the failover priorities configured for the - account. - :vartype enable_automatic_failover: bool - :ivar capabilities: List of Cosmos DB capabilities for the account. - :vartype capabilities: list[~azure.mgmt.cosmosdb.models.Capability] - :ivar virtual_network_rules: List of Virtual Network ACL rules configured for the Cosmos DB - account. - :vartype virtual_network_rules: list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] - :ivar enable_multiple_write_locations: Enables the account to write in multiple locations. - :vartype enable_multiple_write_locations: bool - :ivar enable_cassandra_connector: Enables the cassandra connector on the Cosmos DB C* account. - :vartype enable_cassandra_connector: bool - :ivar connector_offer: The cassandra connector offer type for the Cosmos DB database C* - account. "Small" - :vartype connector_offer: str or ~azure.mgmt.cosmosdb.models.ConnectorOffer - :ivar disable_key_based_metadata_write_access: Disable write operations on metadata resources - (databases, containers, throughput) via account keys. - :vartype disable_key_based_metadata_write_access: bool - :ivar key_vault_key_uri: The URI of the key vault. - :vartype key_vault_key_uri: str - :ivar default_identity: The default identity for accessing key vault used in features like - customer managed keys. The default identity needs to be explicitly set by the users. It can be - "FirstPartyIdentity", "SystemAssignedIdentity" and more. - :vartype default_identity: str - :ivar public_network_access: Whether requests from Public Network are allowed. Known values - are: "Enabled", "Disabled", and "SecuredByPerimeter". - :vartype public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess - :ivar enable_free_tier: Flag to indicate whether Free Tier is enabled. - :vartype enable_free_tier: bool - :ivar api_properties: API specific properties. Currently, supported only for MongoDB API. - :vartype api_properties: ~azure.mgmt.cosmosdb.models.ApiProperties - :ivar enable_analytical_storage: Flag to indicate whether to enable storage analytics. - :vartype enable_analytical_storage: bool - :ivar analytical_storage_configuration: Analytical storage specific properties. - :vartype analytical_storage_configuration: - ~azure.mgmt.cosmosdb.models.AnalyticalStorageConfiguration - :ivar create_mode: Enum to indicate the mode of account creation. Known values are: "Default" - and "Restore". - :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode - :ivar backup_policy: The object representing the policy for taking backups on an account. - :vartype backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy - :ivar cors: The CORS policy for the Cosmos DB database account. - :vartype cors: list[~azure.mgmt.cosmosdb.models.CorsPolicy] - :ivar network_acl_bypass: Indicates what services are allowed to bypass firewall checks. Known - values are: "None" and "AzureServices". - :vartype network_acl_bypass: str or ~azure.mgmt.cosmosdb.models.NetworkAclBypass - :ivar network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network Acl - Bypass for the Cosmos DB account. - :vartype network_acl_bypass_resource_ids: list[str] - :ivar diagnostic_log_settings: The Object representing the different Diagnostic log settings - for the Cosmos DB Account. - :vartype diagnostic_log_settings: ~azure.mgmt.cosmosdb.models.DiagnosticLogSettings - :ivar disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be - used exclusively for authentication. - :vartype disable_local_auth: bool - :ivar restore_parameters: Parameters to indicate the information about the restore. - :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.RestoreParameters - :ivar capacity: The object that represents all properties related to capacity enforcement on an - account. - :vartype capacity: ~azure.mgmt.cosmosdb.models.Capacity - :ivar capacity_mode: Indicates the capacityMode of the Cosmos DB account. Known values are: - "None", "Provisioned", and "Serverless". - :vartype capacity_mode: str or ~azure.mgmt.cosmosdb.models.CapacityMode - :ivar enable_materialized_views: Flag to indicate whether to enable MaterializedViews on the - Cosmos DB account. - :vartype enable_materialized_views: bool - :ivar keys_metadata: This property is ignored during the update/create operation, as the - metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB - account. - :vartype keys_metadata: ~azure.mgmt.cosmosdb.models.DatabaseAccountKeysMetadata - :ivar enable_partition_merge: Flag to indicate enabling/disabling of Partition Merge feature on - the account. - :vartype enable_partition_merge: bool - :ivar enable_burst_capacity: Flag to indicate enabling/disabling of Burst Capacity Preview - feature on the account. - :vartype enable_burst_capacity: bool - :ivar minimal_tls_version: Indicates the minimum allowed Tls version. The default is Tls 1.0, - except for Cassandra and Mongo API's, which only work with Tls 1.2. Known values are: "Tls", - "Tls11", and "Tls12". - :vartype minimal_tls_version: str or ~azure.mgmt.cosmosdb.models.MinimalTlsVersion - :ivar customer_managed_key_status: Indicates the status of the Customer Managed Key feature on - the account. In case there are errors, the property provides troubleshooting guidance. - :vartype customer_managed_key_status: str - :ivar enable_priority_based_execution: Flag to indicate enabling/disabling of Priority Based - Execution Preview feature on the account. - :vartype enable_priority_based_execution: bool - :ivar default_priority_level: Enum to indicate default Priority Level of request for Priority - Based Execution. Known values are: "High" and "Low". - :vartype default_priority_level: str or ~azure.mgmt.cosmosdb.models.DefaultPriorityLevel - :ivar enable_per_region_per_partition_autoscale: Flag to indicate enabling/disabling of - Per-Region Per-partition autoscale Preview feature on the account. - :vartype enable_per_region_per_partition_autoscale: bool - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "locations": {"required": True}, - "database_account_offer_type": {"required": True, "constant": True}, - "keys_metadata": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "kind": {"key": "kind", "type": "str"}, - "consistency_policy": {"key": "properties.consistencyPolicy", "type": "ConsistencyPolicy"}, - "locations": {"key": "properties.locations", "type": "[Location]"}, - "database_account_offer_type": {"key": "properties.databaseAccountOfferType", "type": "str"}, - "ip_rules": {"key": "properties.ipRules", "type": "[IpAddressOrRange]"}, - "is_virtual_network_filter_enabled": {"key": "properties.isVirtualNetworkFilterEnabled", "type": "bool"}, - "enable_automatic_failover": {"key": "properties.enableAutomaticFailover", "type": "bool"}, - "capabilities": {"key": "properties.capabilities", "type": "[Capability]"}, - "virtual_network_rules": {"key": "properties.virtualNetworkRules", "type": "[VirtualNetworkRule]"}, - "enable_multiple_write_locations": {"key": "properties.enableMultipleWriteLocations", "type": "bool"}, - "enable_cassandra_connector": {"key": "properties.enableCassandraConnector", "type": "bool"}, - "connector_offer": {"key": "properties.connectorOffer", "type": "str"}, - "disable_key_based_metadata_write_access": { - "key": "properties.disableKeyBasedMetadataWriteAccess", - "type": "bool", - }, - "key_vault_key_uri": {"key": "properties.keyVaultKeyUri", "type": "str"}, - "default_identity": {"key": "properties.defaultIdentity", "type": "str"}, - "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, - "enable_free_tier": {"key": "properties.enableFreeTier", "type": "bool"}, - "api_properties": {"key": "properties.apiProperties", "type": "ApiProperties"}, - "enable_analytical_storage": {"key": "properties.enableAnalyticalStorage", "type": "bool"}, - "analytical_storage_configuration": { - "key": "properties.analyticalStorageConfiguration", - "type": "AnalyticalStorageConfiguration", - }, - "create_mode": {"key": "properties.createMode", "type": "str"}, - "backup_policy": {"key": "properties.backupPolicy", "type": "BackupPolicy"}, - "cors": {"key": "properties.cors", "type": "[CorsPolicy]"}, - "network_acl_bypass": {"key": "properties.networkAclBypass", "type": "str"}, - "network_acl_bypass_resource_ids": {"key": "properties.networkAclBypassResourceIds", "type": "[str]"}, - "diagnostic_log_settings": {"key": "properties.diagnosticLogSettings", "type": "DiagnosticLogSettings"}, - "disable_local_auth": {"key": "properties.disableLocalAuth", "type": "bool"}, - "restore_parameters": {"key": "properties.restoreParameters", "type": "RestoreParameters"}, - "capacity": {"key": "properties.capacity", "type": "Capacity"}, - "capacity_mode": {"key": "properties.capacityMode", "type": "str"}, - "enable_materialized_views": {"key": "properties.enableMaterializedViews", "type": "bool"}, - "keys_metadata": {"key": "properties.keysMetadata", "type": "DatabaseAccountKeysMetadata"}, - "enable_partition_merge": {"key": "properties.enablePartitionMerge", "type": "bool"}, - "enable_burst_capacity": {"key": "properties.enableBurstCapacity", "type": "bool"}, - "minimal_tls_version": {"key": "properties.minimalTlsVersion", "type": "str"}, - "customer_managed_key_status": {"key": "properties.customerManagedKeyStatus", "type": "str"}, - "enable_priority_based_execution": {"key": "properties.enablePriorityBasedExecution", "type": "bool"}, - "default_priority_level": {"key": "properties.defaultPriorityLevel", "type": "str"}, - "enable_per_region_per_partition_autoscale": { - "key": "properties.enablePerRegionPerPartitionAutoscale", - "type": "bool", - }, - } - - database_account_offer_type = "Standard" - - def __init__( # pylint: disable=too-many-locals - self, - *, - locations: List["_models.Location"], - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - kind: Optional[Union[str, "_models.DatabaseAccountKind"]] = None, - consistency_policy: Optional["_models.ConsistencyPolicy"] = None, - ip_rules: Optional[List["_models.IpAddressOrRange"]] = None, - is_virtual_network_filter_enabled: Optional[bool] = None, - enable_automatic_failover: Optional[bool] = None, - capabilities: Optional[List["_models.Capability"]] = None, - virtual_network_rules: Optional[List["_models.VirtualNetworkRule"]] = None, - enable_multiple_write_locations: Optional[bool] = None, - enable_cassandra_connector: Optional[bool] = None, - connector_offer: Optional[Union[str, "_models.ConnectorOffer"]] = None, - disable_key_based_metadata_write_access: Optional[bool] = None, - key_vault_key_uri: Optional[str] = None, - default_identity: Optional[str] = None, - public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, - enable_free_tier: Optional[bool] = None, - api_properties: Optional["_models.ApiProperties"] = None, - enable_analytical_storage: Optional[bool] = None, - analytical_storage_configuration: Optional["_models.AnalyticalStorageConfiguration"] = None, - create_mode: Union[str, "_models.CreateMode"] = "Default", - backup_policy: Optional["_models.BackupPolicy"] = None, - cors: Optional[List["_models.CorsPolicy"]] = None, - network_acl_bypass: Optional[Union[str, "_models.NetworkAclBypass"]] = None, - network_acl_bypass_resource_ids: Optional[List[str]] = None, - diagnostic_log_settings: Optional["_models.DiagnosticLogSettings"] = None, - disable_local_auth: Optional[bool] = None, - restore_parameters: Optional["_models.RestoreParameters"] = None, - capacity: Optional["_models.Capacity"] = None, - capacity_mode: Optional[Union[str, "_models.CapacityMode"]] = None, - enable_materialized_views: Optional[bool] = None, - enable_partition_merge: Optional[bool] = None, - enable_burst_capacity: Optional[bool] = None, - minimal_tls_version: Optional[Union[str, "_models.MinimalTlsVersion"]] = None, - customer_managed_key_status: Optional[str] = None, - enable_priority_based_execution: Optional[bool] = None, - default_priority_level: Optional[Union[str, "_models.DefaultPriorityLevel"]] = None, - enable_per_region_per_partition_autoscale: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :keyword kind: Indicates the type of database account. This can only be set at database account - creation. Known values are: "GlobalDocumentDB", "MongoDB", and "Parse". - :paramtype kind: str or ~azure.mgmt.cosmosdb.models.DatabaseAccountKind - :keyword consistency_policy: The consistency policy for the Cosmos DB account. - :paramtype consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy - :keyword locations: An array that contains the georeplication locations enabled for the Cosmos - DB account. Required. - :paramtype locations: list[~azure.mgmt.cosmosdb.models.Location] - :keyword ip_rules: List of IpRules. - :paramtype ip_rules: list[~azure.mgmt.cosmosdb.models.IpAddressOrRange] - :keyword is_virtual_network_filter_enabled: Flag to indicate whether to enable/disable Virtual - Network ACL rules. - :paramtype is_virtual_network_filter_enabled: bool - :keyword enable_automatic_failover: Enables automatic failover of the write region in the rare - event that the region is unavailable due to an outage. Automatic failover will result in a new - write region for the account and is chosen based on the failover priorities configured for the - account. - :paramtype enable_automatic_failover: bool - :keyword capabilities: List of Cosmos DB capabilities for the account. - :paramtype capabilities: list[~azure.mgmt.cosmosdb.models.Capability] - :keyword virtual_network_rules: List of Virtual Network ACL rules configured for the Cosmos DB - account. - :paramtype virtual_network_rules: list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] - :keyword enable_multiple_write_locations: Enables the account to write in multiple locations. - :paramtype enable_multiple_write_locations: bool - :keyword enable_cassandra_connector: Enables the cassandra connector on the Cosmos DB C* - account. - :paramtype enable_cassandra_connector: bool - :keyword connector_offer: The cassandra connector offer type for the Cosmos DB database C* - account. "Small" - :paramtype connector_offer: str or ~azure.mgmt.cosmosdb.models.ConnectorOffer - :keyword disable_key_based_metadata_write_access: Disable write operations on metadata - resources (databases, containers, throughput) via account keys. - :paramtype disable_key_based_metadata_write_access: bool - :keyword key_vault_key_uri: The URI of the key vault. - :paramtype key_vault_key_uri: str - :keyword default_identity: The default identity for accessing key vault used in features like - customer managed keys. The default identity needs to be explicitly set by the users. It can be - "FirstPartyIdentity", "SystemAssignedIdentity" and more. - :paramtype default_identity: str - :keyword public_network_access: Whether requests from Public Network are allowed. Known values - are: "Enabled", "Disabled", and "SecuredByPerimeter". - :paramtype public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess - :keyword enable_free_tier: Flag to indicate whether Free Tier is enabled. - :paramtype enable_free_tier: bool - :keyword api_properties: API specific properties. Currently, supported only for MongoDB API. - :paramtype api_properties: ~azure.mgmt.cosmosdb.models.ApiProperties - :keyword enable_analytical_storage: Flag to indicate whether to enable storage analytics. - :paramtype enable_analytical_storage: bool - :keyword analytical_storage_configuration: Analytical storage specific properties. - :paramtype analytical_storage_configuration: - ~azure.mgmt.cosmosdb.models.AnalyticalStorageConfiguration - :keyword create_mode: Enum to indicate the mode of account creation. Known values are: - "Default" and "Restore". - :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode - :keyword backup_policy: The object representing the policy for taking backups on an account. - :paramtype backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy - :keyword cors: The CORS policy for the Cosmos DB database account. - :paramtype cors: list[~azure.mgmt.cosmosdb.models.CorsPolicy] - :keyword network_acl_bypass: Indicates what services are allowed to bypass firewall checks. - Known values are: "None" and "AzureServices". - :paramtype network_acl_bypass: str or ~azure.mgmt.cosmosdb.models.NetworkAclBypass - :keyword network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network - Acl Bypass for the Cosmos DB account. - :paramtype network_acl_bypass_resource_ids: list[str] - :keyword diagnostic_log_settings: The Object representing the different Diagnostic log settings - for the Cosmos DB Account. - :paramtype diagnostic_log_settings: ~azure.mgmt.cosmosdb.models.DiagnosticLogSettings - :keyword disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be - used exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword restore_parameters: Parameters to indicate the information about the restore. - :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.RestoreParameters - :keyword capacity: The object that represents all properties related to capacity enforcement on - an account. - :paramtype capacity: ~azure.mgmt.cosmosdb.models.Capacity - :keyword capacity_mode: Indicates the capacityMode of the Cosmos DB account. Known values are: - "None", "Provisioned", and "Serverless". - :paramtype capacity_mode: str or ~azure.mgmt.cosmosdb.models.CapacityMode - :keyword enable_materialized_views: Flag to indicate whether to enable MaterializedViews on the - Cosmos DB account. - :paramtype enable_materialized_views: bool - :keyword enable_partition_merge: Flag to indicate enabling/disabling of Partition Merge feature - on the account. - :paramtype enable_partition_merge: bool - :keyword enable_burst_capacity: Flag to indicate enabling/disabling of Burst Capacity Preview - feature on the account. - :paramtype enable_burst_capacity: bool - :keyword minimal_tls_version: Indicates the minimum allowed Tls version. The default is Tls - 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. Known values are: - "Tls", "Tls11", and "Tls12". - :paramtype minimal_tls_version: str or ~azure.mgmt.cosmosdb.models.MinimalTlsVersion - :keyword customer_managed_key_status: Indicates the status of the Customer Managed Key feature - on the account. In case there are errors, the property provides troubleshooting guidance. - :paramtype customer_managed_key_status: str - :keyword enable_priority_based_execution: Flag to indicate enabling/disabling of Priority Based - Execution Preview feature on the account. - :paramtype enable_priority_based_execution: bool - :keyword default_priority_level: Enum to indicate default Priority Level of request for - Priority Based Execution. Known values are: "High" and "Low". - :paramtype default_priority_level: str or ~azure.mgmt.cosmosdb.models.DefaultPriorityLevel - :keyword enable_per_region_per_partition_autoscale: Flag to indicate enabling/disabling of - Per-Region Per-partition autoscale Preview feature on the account. - :paramtype enable_per_region_per_partition_autoscale: bool - """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.kind = kind - self.consistency_policy = consistency_policy - self.locations = locations - self.ip_rules = ip_rules - self.is_virtual_network_filter_enabled = is_virtual_network_filter_enabled - self.enable_automatic_failover = enable_automatic_failover - self.capabilities = capabilities - self.virtual_network_rules = virtual_network_rules - self.enable_multiple_write_locations = enable_multiple_write_locations - self.enable_cassandra_connector = enable_cassandra_connector - self.connector_offer = connector_offer - self.disable_key_based_metadata_write_access = disable_key_based_metadata_write_access - self.key_vault_key_uri = key_vault_key_uri - self.default_identity = default_identity - self.public_network_access = public_network_access - self.enable_free_tier = enable_free_tier - self.api_properties = api_properties - self.enable_analytical_storage = enable_analytical_storage - self.analytical_storage_configuration = analytical_storage_configuration - self.create_mode = create_mode - self.backup_policy = backup_policy - self.cors = cors - self.network_acl_bypass = network_acl_bypass - self.network_acl_bypass_resource_ids = network_acl_bypass_resource_ids - self.diagnostic_log_settings = diagnostic_log_settings - self.disable_local_auth = disable_local_auth - self.restore_parameters = restore_parameters - self.capacity = capacity - self.capacity_mode = capacity_mode - self.enable_materialized_views = enable_materialized_views - self.keys_metadata = None - self.enable_partition_merge = enable_partition_merge - self.enable_burst_capacity = enable_burst_capacity - self.minimal_tls_version = minimal_tls_version - self.customer_managed_key_status = customer_managed_key_status - self.enable_priority_based_execution = enable_priority_based_execution - self.default_priority_level = default_priority_level - self.enable_per_region_per_partition_autoscale = enable_per_region_per_partition_autoscale - - -class DatabaseAccountGetResults(ARMResourceProperties): - """An Azure Cosmos DB database account. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar location: The location of the resource group to which the resource belongs. - :vartype location: str - :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :ivar kind: Indicates the type of database account. This can only be set at database account - creation. Known values are: "GlobalDocumentDB", "MongoDB", and "Parse". - :vartype kind: str or ~azure.mgmt.cosmosdb.models.DatabaseAccountKind - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.cosmosdb.models.SystemData - :ivar provisioning_state: The provisioning state of the resource. - :vartype provisioning_state: str - :ivar document_endpoint: The connection endpoint for the Cosmos DB database account. - :vartype document_endpoint: str - :ivar database_account_offer_type: The offer type for the Cosmos DB database account. Default - value: Standard. Default value is "Standard". - :vartype database_account_offer_type: str - :ivar ip_rules: List of IpRules. - :vartype ip_rules: list[~azure.mgmt.cosmosdb.models.IpAddressOrRange] - :ivar is_virtual_network_filter_enabled: Flag to indicate whether to enable/disable Virtual - Network ACL rules. - :vartype is_virtual_network_filter_enabled: bool - :ivar enable_automatic_failover: Enables automatic failover of the write region in the rare - event that the region is unavailable due to an outage. Automatic failover will result in a new - write region for the account and is chosen based on the failover priorities configured for the - account. - :vartype enable_automatic_failover: bool - :ivar consistency_policy: The consistency policy for the Cosmos DB database account. - :vartype consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy - :ivar capabilities: List of Cosmos DB capabilities for the account. - :vartype capabilities: list[~azure.mgmt.cosmosdb.models.Capability] - :ivar write_locations: An array that contains the write location for the Cosmos DB account. - :vartype write_locations: list[~azure.mgmt.cosmosdb.models.Location] - :ivar read_locations: An array that contains of the read locations enabled for the Cosmos DB - account. - :vartype read_locations: list[~azure.mgmt.cosmosdb.models.Location] - :ivar locations: An array that contains all of the locations enabled for the Cosmos DB account. - :vartype locations: list[~azure.mgmt.cosmosdb.models.Location] - :ivar failover_policies: An array that contains the regions ordered by their failover - priorities. - :vartype failover_policies: list[~azure.mgmt.cosmosdb.models.FailoverPolicy] - :ivar virtual_network_rules: List of Virtual Network ACL rules configured for the Cosmos DB - account. - :vartype virtual_network_rules: list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] - :ivar private_endpoint_connections: List of Private Endpoint Connections configured for the - Cosmos DB account. - :vartype private_endpoint_connections: - list[~azure.mgmt.cosmosdb.models.PrivateEndpointConnection] - :ivar enable_multiple_write_locations: Enables the account to write in multiple locations. - :vartype enable_multiple_write_locations: bool - :ivar enable_cassandra_connector: Enables the cassandra connector on the Cosmos DB C* account. - :vartype enable_cassandra_connector: bool - :ivar connector_offer: The cassandra connector offer type for the Cosmos DB database C* - account. "Small" - :vartype connector_offer: str or ~azure.mgmt.cosmosdb.models.ConnectorOffer - :ivar disable_key_based_metadata_write_access: Disable write operations on metadata resources - (databases, containers, throughput) via account keys. - :vartype disable_key_based_metadata_write_access: bool - :ivar key_vault_key_uri: The URI of the key vault. - :vartype key_vault_key_uri: str - :ivar default_identity: The default identity for accessing key vault used in features like - customer managed keys. The default identity needs to be explicitly set by the users. It can be - "FirstPartyIdentity", "SystemAssignedIdentity" and more. - :vartype default_identity: str - :ivar public_network_access: Whether requests from Public Network are allowed. Known values - are: "Enabled", "Disabled", and "SecuredByPerimeter". - :vartype public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess - :ivar enable_free_tier: Flag to indicate whether Free Tier is enabled. - :vartype enable_free_tier: bool - :ivar api_properties: API specific properties. - :vartype api_properties: ~azure.mgmt.cosmosdb.models.ApiProperties - :ivar enable_analytical_storage: Flag to indicate whether to enable storage analytics. - :vartype enable_analytical_storage: bool - :ivar analytical_storage_configuration: Analytical storage specific properties. - :vartype analytical_storage_configuration: - ~azure.mgmt.cosmosdb.models.AnalyticalStorageConfiguration - :ivar instance_id: A unique identifier assigned to the database account. - :vartype instance_id: str - :ivar create_mode: Enum to indicate the mode of account creation. Known values are: "Default" - and "Restore". - :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode - :ivar restore_parameters: Parameters to indicate the information about the restore. - :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.RestoreParameters - :ivar backup_policy: The object representing the policy for taking backups on an account. - :vartype backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy - :ivar cors: The CORS policy for the Cosmos DB database account. - :vartype cors: list[~azure.mgmt.cosmosdb.models.CorsPolicy] - :ivar network_acl_bypass: Indicates what services are allowed to bypass firewall checks. Known - values are: "None" and "AzureServices". - :vartype network_acl_bypass: str or ~azure.mgmt.cosmosdb.models.NetworkAclBypass - :ivar network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network Acl - Bypass for the Cosmos DB account. - :vartype network_acl_bypass_resource_ids: list[str] - :ivar diagnostic_log_settings: The Object representing the different Diagnostic log settings - for the Cosmos DB Account. - :vartype diagnostic_log_settings: ~azure.mgmt.cosmosdb.models.DiagnosticLogSettings - :ivar disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be - used exclusively for authentication. - :vartype disable_local_auth: bool - :ivar capacity: The object that represents all properties related to capacity enforcement on an - account. - :vartype capacity: ~azure.mgmt.cosmosdb.models.Capacity - :ivar capacity_mode: Indicates the capacityMode of the Cosmos DB account. Known values are: - "None", "Provisioned", and "Serverless". - :vartype capacity_mode: str or ~azure.mgmt.cosmosdb.models.CapacityMode - :ivar capacity_mode_change_transition_state: The object that represents the migration state for - the CapacityMode of the Cosmos DB account. - :vartype capacity_mode_change_transition_state: - ~azure.mgmt.cosmosdb.models.CapacityModeChangeTransitionState - :ivar enable_materialized_views: Flag to indicate whether to enable MaterializedViews on the - Cosmos DB account. - :vartype enable_materialized_views: bool - :ivar keys_metadata: The object that represents the metadata for the Account Keys of the Cosmos - DB account. - :vartype keys_metadata: ~azure.mgmt.cosmosdb.models.DatabaseAccountKeysMetadata - :ivar enable_partition_merge: Flag to indicate enabling/disabling of Partition Merge feature on - the account. - :vartype enable_partition_merge: bool - :ivar enable_burst_capacity: Flag to indicate enabling/disabling of Burst Capacity Preview - feature on the account. - :vartype enable_burst_capacity: bool - :ivar minimal_tls_version: Indicates the minimum allowed Tls version. The default is Tls 1.0, - except for Cassandra and Mongo API's, which only work with Tls 1.2. Known values are: "Tls", - "Tls11", and "Tls12". - :vartype minimal_tls_version: str or ~azure.mgmt.cosmosdb.models.MinimalTlsVersion - :ivar customer_managed_key_status: Indicates the status of the Customer Managed Key feature on - the account. In case there are errors, the property provides troubleshooting guidance. - :vartype customer_managed_key_status: str - :ivar enable_priority_based_execution: Flag to indicate enabling/disabling of Priority Based - Execution Preview feature on the account. - :vartype enable_priority_based_execution: bool - :ivar default_priority_level: Enum to indicate default Priority Level of request for Priority - Based Execution. Known values are: "High" and "Low". - :vartype default_priority_level: str or ~azure.mgmt.cosmosdb.models.DefaultPriorityLevel - :ivar enable_per_region_per_partition_autoscale: Flag to indicate enabling/disabling of - Per-Region Per-partition autoscale Preview feature on the account. - :vartype enable_per_region_per_partition_autoscale: bool - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "document_endpoint": {"readonly": True}, - "database_account_offer_type": {"readonly": True}, - "write_locations": {"readonly": True}, - "read_locations": {"readonly": True}, - "locations": {"readonly": True}, - "failover_policies": {"readonly": True}, - "private_endpoint_connections": {"readonly": True}, - "instance_id": {"readonly": True}, - "keys_metadata": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "kind": {"key": "kind", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "document_endpoint": {"key": "properties.documentEndpoint", "type": "str"}, - "database_account_offer_type": {"key": "properties.databaseAccountOfferType", "type": "str"}, - "ip_rules": {"key": "properties.ipRules", "type": "[IpAddressOrRange]"}, - "is_virtual_network_filter_enabled": {"key": "properties.isVirtualNetworkFilterEnabled", "type": "bool"}, - "enable_automatic_failover": {"key": "properties.enableAutomaticFailover", "type": "bool"}, - "consistency_policy": {"key": "properties.consistencyPolicy", "type": "ConsistencyPolicy"}, - "capabilities": {"key": "properties.capabilities", "type": "[Capability]"}, - "write_locations": {"key": "properties.writeLocations", "type": "[Location]"}, - "read_locations": {"key": "properties.readLocations", "type": "[Location]"}, - "locations": {"key": "properties.locations", "type": "[Location]"}, - "failover_policies": {"key": "properties.failoverPolicies", "type": "[FailoverPolicy]"}, - "virtual_network_rules": {"key": "properties.virtualNetworkRules", "type": "[VirtualNetworkRule]"}, - "private_endpoint_connections": { - "key": "properties.privateEndpointConnections", - "type": "[PrivateEndpointConnection]", - }, - "enable_multiple_write_locations": {"key": "properties.enableMultipleWriteLocations", "type": "bool"}, - "enable_cassandra_connector": {"key": "properties.enableCassandraConnector", "type": "bool"}, - "connector_offer": {"key": "properties.connectorOffer", "type": "str"}, - "disable_key_based_metadata_write_access": { - "key": "properties.disableKeyBasedMetadataWriteAccess", - "type": "bool", - }, - "key_vault_key_uri": {"key": "properties.keyVaultKeyUri", "type": "str"}, - "default_identity": {"key": "properties.defaultIdentity", "type": "str"}, - "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, - "enable_free_tier": {"key": "properties.enableFreeTier", "type": "bool"}, - "api_properties": {"key": "properties.apiProperties", "type": "ApiProperties"}, - "enable_analytical_storage": {"key": "properties.enableAnalyticalStorage", "type": "bool"}, - "analytical_storage_configuration": { - "key": "properties.analyticalStorageConfiguration", - "type": "AnalyticalStorageConfiguration", - }, - "instance_id": {"key": "properties.instanceId", "type": "str"}, - "create_mode": {"key": "properties.createMode", "type": "str"}, - "restore_parameters": {"key": "properties.restoreParameters", "type": "RestoreParameters"}, - "backup_policy": {"key": "properties.backupPolicy", "type": "BackupPolicy"}, - "cors": {"key": "properties.cors", "type": "[CorsPolicy]"}, - "network_acl_bypass": {"key": "properties.networkAclBypass", "type": "str"}, - "network_acl_bypass_resource_ids": {"key": "properties.networkAclBypassResourceIds", "type": "[str]"}, - "diagnostic_log_settings": {"key": "properties.diagnosticLogSettings", "type": "DiagnosticLogSettings"}, - "disable_local_auth": {"key": "properties.disableLocalAuth", "type": "bool"}, - "capacity": {"key": "properties.capacity", "type": "Capacity"}, - "capacity_mode": {"key": "properties.capacityMode", "type": "str"}, - "capacity_mode_change_transition_state": { - "key": "properties.capacityModeChangeTransitionState", - "type": "CapacityModeChangeTransitionState", - }, - "enable_materialized_views": {"key": "properties.enableMaterializedViews", "type": "bool"}, - "keys_metadata": {"key": "properties.keysMetadata", "type": "DatabaseAccountKeysMetadata"}, - "enable_partition_merge": {"key": "properties.enablePartitionMerge", "type": "bool"}, - "enable_burst_capacity": {"key": "properties.enableBurstCapacity", "type": "bool"}, - "minimal_tls_version": {"key": "properties.minimalTlsVersion", "type": "str"}, - "customer_managed_key_status": {"key": "properties.customerManagedKeyStatus", "type": "str"}, - "enable_priority_based_execution": {"key": "properties.enablePriorityBasedExecution", "type": "bool"}, - "default_priority_level": {"key": "properties.defaultPriorityLevel", "type": "str"}, - "enable_per_region_per_partition_autoscale": { - "key": "properties.enablePerRegionPerPartitionAutoscale", - "type": "bool", - }, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - kind: Optional[Union[str, "_models.DatabaseAccountKind"]] = None, - ip_rules: Optional[List["_models.IpAddressOrRange"]] = None, - is_virtual_network_filter_enabled: Optional[bool] = None, - enable_automatic_failover: Optional[bool] = None, - consistency_policy: Optional["_models.ConsistencyPolicy"] = None, - capabilities: Optional[List["_models.Capability"]] = None, - virtual_network_rules: Optional[List["_models.VirtualNetworkRule"]] = None, - enable_multiple_write_locations: Optional[bool] = None, - enable_cassandra_connector: Optional[bool] = None, - connector_offer: Optional[Union[str, "_models.ConnectorOffer"]] = None, - disable_key_based_metadata_write_access: Optional[bool] = None, - key_vault_key_uri: Optional[str] = None, - default_identity: Optional[str] = None, - public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, - enable_free_tier: Optional[bool] = None, - api_properties: Optional["_models.ApiProperties"] = None, - enable_analytical_storage: Optional[bool] = None, - analytical_storage_configuration: Optional["_models.AnalyticalStorageConfiguration"] = None, - create_mode: Union[str, "_models.CreateMode"] = "Default", - restore_parameters: Optional["_models.RestoreParameters"] = None, - backup_policy: Optional["_models.BackupPolicy"] = None, - cors: Optional[List["_models.CorsPolicy"]] = None, - network_acl_bypass: Optional[Union[str, "_models.NetworkAclBypass"]] = None, - network_acl_bypass_resource_ids: Optional[List[str]] = None, - diagnostic_log_settings: Optional["_models.DiagnosticLogSettings"] = None, - disable_local_auth: Optional[bool] = None, - capacity: Optional["_models.Capacity"] = None, - capacity_mode: Optional[Union[str, "_models.CapacityMode"]] = None, - capacity_mode_change_transition_state: Optional["_models.CapacityModeChangeTransitionState"] = None, - enable_materialized_views: Optional[bool] = None, - enable_partition_merge: Optional[bool] = None, - enable_burst_capacity: Optional[bool] = None, - minimal_tls_version: Optional[Union[str, "_models.MinimalTlsVersion"]] = None, - customer_managed_key_status: Optional[str] = None, - enable_priority_based_execution: Optional[bool] = None, - default_priority_level: Optional[Union[str, "_models.DefaultPriorityLevel"]] = None, - enable_per_region_per_partition_autoscale: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :keyword kind: Indicates the type of database account. This can only be set at database account - creation. Known values are: "GlobalDocumentDB", "MongoDB", and "Parse". - :paramtype kind: str or ~azure.mgmt.cosmosdb.models.DatabaseAccountKind - :keyword ip_rules: List of IpRules. - :paramtype ip_rules: list[~azure.mgmt.cosmosdb.models.IpAddressOrRange] - :keyword is_virtual_network_filter_enabled: Flag to indicate whether to enable/disable Virtual - Network ACL rules. - :paramtype is_virtual_network_filter_enabled: bool - :keyword enable_automatic_failover: Enables automatic failover of the write region in the rare - event that the region is unavailable due to an outage. Automatic failover will result in a new - write region for the account and is chosen based on the failover priorities configured for the - account. - :paramtype enable_automatic_failover: bool - :keyword consistency_policy: The consistency policy for the Cosmos DB database account. - :paramtype consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy - :keyword capabilities: List of Cosmos DB capabilities for the account. - :paramtype capabilities: list[~azure.mgmt.cosmosdb.models.Capability] - :keyword virtual_network_rules: List of Virtual Network ACL rules configured for the Cosmos DB - account. - :paramtype virtual_network_rules: list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] - :keyword enable_multiple_write_locations: Enables the account to write in multiple locations. - :paramtype enable_multiple_write_locations: bool - :keyword enable_cassandra_connector: Enables the cassandra connector on the Cosmos DB C* - account. - :paramtype enable_cassandra_connector: bool - :keyword connector_offer: The cassandra connector offer type for the Cosmos DB database C* - account. "Small" - :paramtype connector_offer: str or ~azure.mgmt.cosmosdb.models.ConnectorOffer - :keyword disable_key_based_metadata_write_access: Disable write operations on metadata - resources (databases, containers, throughput) via account keys. - :paramtype disable_key_based_metadata_write_access: bool - :keyword key_vault_key_uri: The URI of the key vault. - :paramtype key_vault_key_uri: str - :keyword default_identity: The default identity for accessing key vault used in features like - customer managed keys. The default identity needs to be explicitly set by the users. It can be - "FirstPartyIdentity", "SystemAssignedIdentity" and more. - :paramtype default_identity: str - :keyword public_network_access: Whether requests from Public Network are allowed. Known values - are: "Enabled", "Disabled", and "SecuredByPerimeter". - :paramtype public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess - :keyword enable_free_tier: Flag to indicate whether Free Tier is enabled. - :paramtype enable_free_tier: bool - :keyword api_properties: API specific properties. - :paramtype api_properties: ~azure.mgmt.cosmosdb.models.ApiProperties - :keyword enable_analytical_storage: Flag to indicate whether to enable storage analytics. - :paramtype enable_analytical_storage: bool - :keyword analytical_storage_configuration: Analytical storage specific properties. - :paramtype analytical_storage_configuration: - ~azure.mgmt.cosmosdb.models.AnalyticalStorageConfiguration - :keyword create_mode: Enum to indicate the mode of account creation. Known values are: - "Default" and "Restore". - :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode - :keyword restore_parameters: Parameters to indicate the information about the restore. - :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.RestoreParameters - :keyword backup_policy: The object representing the policy for taking backups on an account. - :paramtype backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy - :keyword cors: The CORS policy for the Cosmos DB database account. - :paramtype cors: list[~azure.mgmt.cosmosdb.models.CorsPolicy] - :keyword network_acl_bypass: Indicates what services are allowed to bypass firewall checks. - Known values are: "None" and "AzureServices". - :paramtype network_acl_bypass: str or ~azure.mgmt.cosmosdb.models.NetworkAclBypass - :keyword network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network - Acl Bypass for the Cosmos DB account. - :paramtype network_acl_bypass_resource_ids: list[str] - :keyword diagnostic_log_settings: The Object representing the different Diagnostic log settings - for the Cosmos DB Account. - :paramtype diagnostic_log_settings: ~azure.mgmt.cosmosdb.models.DiagnosticLogSettings - :keyword disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be - used exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword capacity: The object that represents all properties related to capacity enforcement on - an account. - :paramtype capacity: ~azure.mgmt.cosmosdb.models.Capacity - :keyword capacity_mode: Indicates the capacityMode of the Cosmos DB account. Known values are: - "None", "Provisioned", and "Serverless". - :paramtype capacity_mode: str or ~azure.mgmt.cosmosdb.models.CapacityMode - :keyword capacity_mode_change_transition_state: The object that represents the migration state - for the CapacityMode of the Cosmos DB account. - :paramtype capacity_mode_change_transition_state: - ~azure.mgmt.cosmosdb.models.CapacityModeChangeTransitionState - :keyword enable_materialized_views: Flag to indicate whether to enable MaterializedViews on the - Cosmos DB account. - :paramtype enable_materialized_views: bool - :keyword enable_partition_merge: Flag to indicate enabling/disabling of Partition Merge feature - on the account. - :paramtype enable_partition_merge: bool - :keyword enable_burst_capacity: Flag to indicate enabling/disabling of Burst Capacity Preview - feature on the account. - :paramtype enable_burst_capacity: bool - :keyword minimal_tls_version: Indicates the minimum allowed Tls version. The default is Tls - 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. Known values are: - "Tls", "Tls11", and "Tls12". - :paramtype minimal_tls_version: str or ~azure.mgmt.cosmosdb.models.MinimalTlsVersion - :keyword customer_managed_key_status: Indicates the status of the Customer Managed Key feature - on the account. In case there are errors, the property provides troubleshooting guidance. - :paramtype customer_managed_key_status: str - :keyword enable_priority_based_execution: Flag to indicate enabling/disabling of Priority Based - Execution Preview feature on the account. - :paramtype enable_priority_based_execution: bool - :keyword default_priority_level: Enum to indicate default Priority Level of request for - Priority Based Execution. Known values are: "High" and "Low". - :paramtype default_priority_level: str or ~azure.mgmt.cosmosdb.models.DefaultPriorityLevel - :keyword enable_per_region_per_partition_autoscale: Flag to indicate enabling/disabling of - Per-Region Per-partition autoscale Preview feature on the account. - :paramtype enable_per_region_per_partition_autoscale: bool - """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.kind = kind - self.system_data = None - self.provisioning_state = None - self.document_endpoint = None - self.database_account_offer_type = None - self.ip_rules = ip_rules - self.is_virtual_network_filter_enabled = is_virtual_network_filter_enabled - self.enable_automatic_failover = enable_automatic_failover - self.consistency_policy = consistency_policy - self.capabilities = capabilities - self.write_locations = None - self.read_locations = None - self.locations = None - self.failover_policies = None - self.virtual_network_rules = virtual_network_rules - self.private_endpoint_connections = None - self.enable_multiple_write_locations = enable_multiple_write_locations - self.enable_cassandra_connector = enable_cassandra_connector - self.connector_offer = connector_offer - self.disable_key_based_metadata_write_access = disable_key_based_metadata_write_access - self.key_vault_key_uri = key_vault_key_uri - self.default_identity = default_identity - self.public_network_access = public_network_access - self.enable_free_tier = enable_free_tier - self.api_properties = api_properties - self.enable_analytical_storage = enable_analytical_storage - self.analytical_storage_configuration = analytical_storage_configuration - self.instance_id = None - self.create_mode = create_mode - self.restore_parameters = restore_parameters - self.backup_policy = backup_policy - self.cors = cors - self.network_acl_bypass = network_acl_bypass - self.network_acl_bypass_resource_ids = network_acl_bypass_resource_ids - self.diagnostic_log_settings = diagnostic_log_settings - self.disable_local_auth = disable_local_auth - self.capacity = capacity - self.capacity_mode = capacity_mode - self.capacity_mode_change_transition_state = capacity_mode_change_transition_state - self.enable_materialized_views = enable_materialized_views - self.keys_metadata = None - self.enable_partition_merge = enable_partition_merge - self.enable_burst_capacity = enable_burst_capacity - self.minimal_tls_version = minimal_tls_version - self.customer_managed_key_status = customer_managed_key_status - self.enable_priority_based_execution = enable_priority_based_execution - self.default_priority_level = default_priority_level - self.enable_per_region_per_partition_autoscale = enable_per_region_per_partition_autoscale - - -class DatabaseAccountKeysMetadata(_serialization.Model): - """The metadata related to each access key for the given Cosmos DB database account. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar primary_master_key: The metadata related to the Primary Read-Write Key for the given - Cosmos DB database account. - :vartype primary_master_key: ~azure.mgmt.cosmosdb.models.AccountKeyMetadata - :ivar secondary_master_key: The metadata related to the Secondary Read-Write Key for the given - Cosmos DB database account. - :vartype secondary_master_key: ~azure.mgmt.cosmosdb.models.AccountKeyMetadata - :ivar primary_readonly_master_key: The metadata related to the Primary Read-Only Key for the - given Cosmos DB database account. - :vartype primary_readonly_master_key: ~azure.mgmt.cosmosdb.models.AccountKeyMetadata - :ivar secondary_readonly_master_key: The metadata related to the Secondary Read-Only Key for - the given Cosmos DB database account. - :vartype secondary_readonly_master_key: ~azure.mgmt.cosmosdb.models.AccountKeyMetadata - """ - - _validation = { - "primary_master_key": {"readonly": True}, - "secondary_master_key": {"readonly": True}, - "primary_readonly_master_key": {"readonly": True}, - "secondary_readonly_master_key": {"readonly": True}, - } - - _attribute_map = { - "primary_master_key": {"key": "primaryMasterKey", "type": "AccountKeyMetadata"}, - "secondary_master_key": {"key": "secondaryMasterKey", "type": "AccountKeyMetadata"}, - "primary_readonly_master_key": {"key": "primaryReadonlyMasterKey", "type": "AccountKeyMetadata"}, - "secondary_readonly_master_key": {"key": "secondaryReadonlyMasterKey", "type": "AccountKeyMetadata"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.primary_master_key = None - self.secondary_master_key = None - self.primary_readonly_master_key = None - self.secondary_readonly_master_key = None - - -class DatabaseAccountListConnectionStringsResult(_serialization.Model): # pylint: disable=name-too-long - """The connection strings for the given database account. - - :ivar connection_strings: An array that contains the connection strings for the Cosmos DB - account. - :vartype connection_strings: list[~azure.mgmt.cosmosdb.models.DatabaseAccountConnectionString] - """ - - _attribute_map = { - "connection_strings": {"key": "connectionStrings", "type": "[DatabaseAccountConnectionString]"}, - } - - def __init__( - self, *, connection_strings: Optional[List["_models.DatabaseAccountConnectionString"]] = None, **kwargs: Any - ) -> None: - """ - :keyword connection_strings: An array that contains the connection strings for the Cosmos DB - account. - :paramtype connection_strings: - list[~azure.mgmt.cosmosdb.models.DatabaseAccountConnectionString] - """ - super().__init__(**kwargs) - self.connection_strings = connection_strings - - -class DatabaseAccountListReadOnlyKeysResult(_serialization.Model): - """The read-only access keys for the given database account. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar primary_readonly_master_key: Base 64 encoded value of the primary read-only key. - :vartype primary_readonly_master_key: str - :ivar secondary_readonly_master_key: Base 64 encoded value of the secondary read-only key. - :vartype secondary_readonly_master_key: str - """ - - _validation = { - "primary_readonly_master_key": {"readonly": True}, - "secondary_readonly_master_key": {"readonly": True}, - } - - _attribute_map = { - "primary_readonly_master_key": {"key": "primaryReadonlyMasterKey", "type": "str"}, - "secondary_readonly_master_key": {"key": "secondaryReadonlyMasterKey", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.primary_readonly_master_key = None - self.secondary_readonly_master_key = None - - -class DatabaseAccountListKeysResult(DatabaseAccountListReadOnlyKeysResult): - """The access keys for the given database account. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar primary_readonly_master_key: Base 64 encoded value of the primary read-only key. - :vartype primary_readonly_master_key: str - :ivar secondary_readonly_master_key: Base 64 encoded value of the secondary read-only key. - :vartype secondary_readonly_master_key: str - :ivar primary_master_key: Base 64 encoded value of the primary read-write key. - :vartype primary_master_key: str - :ivar secondary_master_key: Base 64 encoded value of the secondary read-write key. - :vartype secondary_master_key: str - """ - - _validation = { - "primary_readonly_master_key": {"readonly": True}, - "secondary_readonly_master_key": {"readonly": True}, - "primary_master_key": {"readonly": True}, - "secondary_master_key": {"readonly": True}, - } - - _attribute_map = { - "primary_readonly_master_key": {"key": "primaryReadonlyMasterKey", "type": "str"}, - "secondary_readonly_master_key": {"key": "secondaryReadonlyMasterKey", "type": "str"}, - "primary_master_key": {"key": "primaryMasterKey", "type": "str"}, - "secondary_master_key": {"key": "secondaryMasterKey", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.primary_master_key = None - self.secondary_master_key = None - - -class DatabaseAccountRegenerateKeyParameters(_serialization.Model): - """Parameters to regenerate the keys within the database account. - - All required parameters must be populated in order to send to server. - - :ivar key_kind: The access key to regenerate. Required. Known values are: "primary", - "secondary", "primaryReadonly", and "secondaryReadonly". - :vartype key_kind: str or ~azure.mgmt.cosmosdb.models.KeyKind - """ - - _validation = { - "key_kind": {"required": True}, - } - - _attribute_map = { - "key_kind": {"key": "keyKind", "type": "str"}, - } - - def __init__(self, *, key_kind: Union[str, "_models.KeyKind"], **kwargs: Any) -> None: - """ - :keyword key_kind: The access key to regenerate. Required. Known values are: "primary", - "secondary", "primaryReadonly", and "secondaryReadonly". - :paramtype key_kind: str or ~azure.mgmt.cosmosdb.models.KeyKind - """ - super().__init__(**kwargs) - self.key_kind = key_kind - - -class DatabaseAccountsListResult(_serialization.Model): - """The List operation response, that contains the database accounts and their properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of database account and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.DatabaseAccountGetResults] - """ - - _validation = { - "value": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DatabaseAccountGetResults]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - - -class DatabaseAccountUpdateParameters(_serialization.Model): - """Parameters for patching Azure Cosmos DB database account properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :vartype tags: dict[str, str] - :ivar location: The location of the resource group to which the resource belongs. - :vartype location: str - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :ivar consistency_policy: The consistency policy for the Cosmos DB account. - :vartype consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy - :ivar locations: An array that contains the georeplication locations enabled for the Cosmos DB - account. - :vartype locations: list[~azure.mgmt.cosmosdb.models.Location] - :ivar ip_rules: List of IpRules. - :vartype ip_rules: list[~azure.mgmt.cosmosdb.models.IpAddressOrRange] - :ivar is_virtual_network_filter_enabled: Flag to indicate whether to enable/disable Virtual - Network ACL rules. - :vartype is_virtual_network_filter_enabled: bool - :ivar enable_automatic_failover: Enables automatic failover of the write region in the rare - event that the region is unavailable due to an outage. Automatic failover will result in a new - write region for the account and is chosen based on the failover priorities configured for the - account. - :vartype enable_automatic_failover: bool - :ivar capabilities: List of Cosmos DB capabilities for the account. - :vartype capabilities: list[~azure.mgmt.cosmosdb.models.Capability] - :ivar virtual_network_rules: List of Virtual Network ACL rules configured for the Cosmos DB - account. - :vartype virtual_network_rules: list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] - :ivar enable_multiple_write_locations: Enables the account to write in multiple locations. - :vartype enable_multiple_write_locations: bool - :ivar enable_cassandra_connector: Enables the cassandra connector on the Cosmos DB C* account. - :vartype enable_cassandra_connector: bool - :ivar connector_offer: The cassandra connector offer type for the Cosmos DB database C* - account. "Small" - :vartype connector_offer: str or ~azure.mgmt.cosmosdb.models.ConnectorOffer - :ivar disable_key_based_metadata_write_access: Disable write operations on metadata resources - (databases, containers, throughput) via account keys. - :vartype disable_key_based_metadata_write_access: bool - :ivar key_vault_key_uri: The URI of the key vault. - :vartype key_vault_key_uri: str - :ivar default_identity: The default identity for accessing key vault used in features like - customer managed keys. The default identity needs to be explicitly set by the users. It can be - "FirstPartyIdentity", "SystemAssignedIdentity" and more. - :vartype default_identity: str - :ivar public_network_access: Whether requests from Public Network are allowed. Known values - are: "Enabled", "Disabled", and "SecuredByPerimeter". - :vartype public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess - :ivar enable_free_tier: Flag to indicate whether Free Tier is enabled. - :vartype enable_free_tier: bool - :ivar api_properties: API specific properties. Currently, supported only for MongoDB API. - :vartype api_properties: ~azure.mgmt.cosmosdb.models.ApiProperties - :ivar enable_analytical_storage: Flag to indicate whether to enable storage analytics. - :vartype enable_analytical_storage: bool - :ivar analytical_storage_configuration: Analytical storage specific properties. - :vartype analytical_storage_configuration: - ~azure.mgmt.cosmosdb.models.AnalyticalStorageConfiguration - :ivar backup_policy: The object representing the policy for taking backups on an account. - :vartype backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy - :ivar cors: The CORS policy for the Cosmos DB database account. - :vartype cors: list[~azure.mgmt.cosmosdb.models.CorsPolicy] - :ivar network_acl_bypass: Indicates what services are allowed to bypass firewall checks. Known - values are: "None" and "AzureServices". - :vartype network_acl_bypass: str or ~azure.mgmt.cosmosdb.models.NetworkAclBypass - :ivar network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network Acl - Bypass for the Cosmos DB account. - :vartype network_acl_bypass_resource_ids: list[str] - :ivar diagnostic_log_settings: The Object representing the different Diagnostic log settings - for the Cosmos DB Account. - :vartype diagnostic_log_settings: ~azure.mgmt.cosmosdb.models.DiagnosticLogSettings - :ivar disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be - used exclusively for authentication. - :vartype disable_local_auth: bool - :ivar capacity: The object that represents all properties related to capacity enforcement on an - account. - :vartype capacity: ~azure.mgmt.cosmosdb.models.Capacity - :ivar capacity_mode: Indicates the capacityMode of the Cosmos DB account. Known values are: - "None", "Provisioned", and "Serverless". - :vartype capacity_mode: str or ~azure.mgmt.cosmosdb.models.CapacityMode - :ivar enable_materialized_views: Flag to indicate whether to enable MaterializedViews on the - Cosmos DB account. - :vartype enable_materialized_views: bool - :ivar keys_metadata: This property is ignored during the update operation, as the metadata is - read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. - :vartype keys_metadata: ~azure.mgmt.cosmosdb.models.DatabaseAccountKeysMetadata - :ivar enable_partition_merge: Flag to indicate enabling/disabling of Partition Merge feature on - the account. - :vartype enable_partition_merge: bool - :ivar enable_burst_capacity: Flag to indicate enabling/disabling of Burst Capacity Preview - feature on the account. - :vartype enable_burst_capacity: bool - :ivar minimal_tls_version: Indicates the minimum allowed Tls version. The default is Tls 1.0, - except for Cassandra and Mongo API's, which only work with Tls 1.2. Known values are: "Tls", - "Tls11", and "Tls12". - :vartype minimal_tls_version: str or ~azure.mgmt.cosmosdb.models.MinimalTlsVersion - :ivar customer_managed_key_status: Indicates the status of the Customer Managed Key feature on - the account. In case there are errors, the property provides troubleshooting guidance. - :vartype customer_managed_key_status: str - :ivar enable_priority_based_execution: Flag to indicate enabling/disabling of Priority Based - Execution Preview feature on the account. - :vartype enable_priority_based_execution: bool - :ivar default_priority_level: Enum to indicate default Priority Level of request for Priority - Based Execution. Known values are: "High" and "Low". - :vartype default_priority_level: str or ~azure.mgmt.cosmosdb.models.DefaultPriorityLevel - :ivar enable_per_region_per_partition_autoscale: Flag to indicate enabling/disabling of - Per-Region Per-partition autoscale Preview feature on the account. - :vartype enable_per_region_per_partition_autoscale: bool - """ - - _validation = { - "keys_metadata": {"readonly": True}, - } - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "consistency_policy": {"key": "properties.consistencyPolicy", "type": "ConsistencyPolicy"}, - "locations": {"key": "properties.locations", "type": "[Location]"}, - "ip_rules": {"key": "properties.ipRules", "type": "[IpAddressOrRange]"}, - "is_virtual_network_filter_enabled": {"key": "properties.isVirtualNetworkFilterEnabled", "type": "bool"}, - "enable_automatic_failover": {"key": "properties.enableAutomaticFailover", "type": "bool"}, - "capabilities": {"key": "properties.capabilities", "type": "[Capability]"}, - "virtual_network_rules": {"key": "properties.virtualNetworkRules", "type": "[VirtualNetworkRule]"}, - "enable_multiple_write_locations": {"key": "properties.enableMultipleWriteLocations", "type": "bool"}, - "enable_cassandra_connector": {"key": "properties.enableCassandraConnector", "type": "bool"}, - "connector_offer": {"key": "properties.connectorOffer", "type": "str"}, - "disable_key_based_metadata_write_access": { - "key": "properties.disableKeyBasedMetadataWriteAccess", - "type": "bool", - }, - "key_vault_key_uri": {"key": "properties.keyVaultKeyUri", "type": "str"}, - "default_identity": {"key": "properties.defaultIdentity", "type": "str"}, - "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, - "enable_free_tier": {"key": "properties.enableFreeTier", "type": "bool"}, - "api_properties": {"key": "properties.apiProperties", "type": "ApiProperties"}, - "enable_analytical_storage": {"key": "properties.enableAnalyticalStorage", "type": "bool"}, - "analytical_storage_configuration": { - "key": "properties.analyticalStorageConfiguration", - "type": "AnalyticalStorageConfiguration", - }, - "backup_policy": {"key": "properties.backupPolicy", "type": "BackupPolicy"}, - "cors": {"key": "properties.cors", "type": "[CorsPolicy]"}, - "network_acl_bypass": {"key": "properties.networkAclBypass", "type": "str"}, - "network_acl_bypass_resource_ids": {"key": "properties.networkAclBypassResourceIds", "type": "[str]"}, - "diagnostic_log_settings": {"key": "properties.diagnosticLogSettings", "type": "DiagnosticLogSettings"}, - "disable_local_auth": {"key": "properties.disableLocalAuth", "type": "bool"}, - "capacity": {"key": "properties.capacity", "type": "Capacity"}, - "capacity_mode": {"key": "properties.capacityMode", "type": "str"}, - "enable_materialized_views": {"key": "properties.enableMaterializedViews", "type": "bool"}, - "keys_metadata": {"key": "properties.keysMetadata", "type": "DatabaseAccountKeysMetadata"}, - "enable_partition_merge": {"key": "properties.enablePartitionMerge", "type": "bool"}, - "enable_burst_capacity": {"key": "properties.enableBurstCapacity", "type": "bool"}, - "minimal_tls_version": {"key": "properties.minimalTlsVersion", "type": "str"}, - "customer_managed_key_status": {"key": "properties.customerManagedKeyStatus", "type": "str"}, - "enable_priority_based_execution": {"key": "properties.enablePriorityBasedExecution", "type": "bool"}, - "default_priority_level": {"key": "properties.defaultPriorityLevel", "type": "str"}, - "enable_per_region_per_partition_autoscale": { - "key": "properties.enablePerRegionPerPartitionAutoscale", - "type": "bool", - }, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - tags: Optional[Dict[str, str]] = None, - location: Optional[str] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - consistency_policy: Optional["_models.ConsistencyPolicy"] = None, - locations: Optional[List["_models.Location"]] = None, - ip_rules: Optional[List["_models.IpAddressOrRange"]] = None, - is_virtual_network_filter_enabled: Optional[bool] = None, - enable_automatic_failover: Optional[bool] = None, - capabilities: Optional[List["_models.Capability"]] = None, - virtual_network_rules: Optional[List["_models.VirtualNetworkRule"]] = None, - enable_multiple_write_locations: Optional[bool] = None, - enable_cassandra_connector: Optional[bool] = None, - connector_offer: Optional[Union[str, "_models.ConnectorOffer"]] = None, - disable_key_based_metadata_write_access: Optional[bool] = None, - key_vault_key_uri: Optional[str] = None, - default_identity: Optional[str] = None, - public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, - enable_free_tier: Optional[bool] = None, - api_properties: Optional["_models.ApiProperties"] = None, - enable_analytical_storage: Optional[bool] = None, - analytical_storage_configuration: Optional["_models.AnalyticalStorageConfiguration"] = None, - backup_policy: Optional["_models.BackupPolicy"] = None, - cors: Optional[List["_models.CorsPolicy"]] = None, - network_acl_bypass: Optional[Union[str, "_models.NetworkAclBypass"]] = None, - network_acl_bypass_resource_ids: Optional[List[str]] = None, - diagnostic_log_settings: Optional["_models.DiagnosticLogSettings"] = None, - disable_local_auth: Optional[bool] = None, - capacity: Optional["_models.Capacity"] = None, - capacity_mode: Optional[Union[str, "_models.CapacityMode"]] = None, - enable_materialized_views: Optional[bool] = None, - enable_partition_merge: Optional[bool] = None, - enable_burst_capacity: Optional[bool] = None, - minimal_tls_version: Optional[Union[str, "_models.MinimalTlsVersion"]] = None, - customer_managed_key_status: Optional[str] = None, - enable_priority_based_execution: Optional[bool] = None, - default_priority_level: Optional[Union[str, "_models.DefaultPriorityLevel"]] = None, - enable_per_region_per_partition_autoscale: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :paramtype tags: dict[str, str] - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :keyword consistency_policy: The consistency policy for the Cosmos DB account. - :paramtype consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy - :keyword locations: An array that contains the georeplication locations enabled for the Cosmos - DB account. - :paramtype locations: list[~azure.mgmt.cosmosdb.models.Location] - :keyword ip_rules: List of IpRules. - :paramtype ip_rules: list[~azure.mgmt.cosmosdb.models.IpAddressOrRange] - :keyword is_virtual_network_filter_enabled: Flag to indicate whether to enable/disable Virtual - Network ACL rules. - :paramtype is_virtual_network_filter_enabled: bool - :keyword enable_automatic_failover: Enables automatic failover of the write region in the rare - event that the region is unavailable due to an outage. Automatic failover will result in a new - write region for the account and is chosen based on the failover priorities configured for the - account. - :paramtype enable_automatic_failover: bool - :keyword capabilities: List of Cosmos DB capabilities for the account. - :paramtype capabilities: list[~azure.mgmt.cosmosdb.models.Capability] - :keyword virtual_network_rules: List of Virtual Network ACL rules configured for the Cosmos DB - account. - :paramtype virtual_network_rules: list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] - :keyword enable_multiple_write_locations: Enables the account to write in multiple locations. - :paramtype enable_multiple_write_locations: bool - :keyword enable_cassandra_connector: Enables the cassandra connector on the Cosmos DB C* - account. - :paramtype enable_cassandra_connector: bool - :keyword connector_offer: The cassandra connector offer type for the Cosmos DB database C* - account. "Small" - :paramtype connector_offer: str or ~azure.mgmt.cosmosdb.models.ConnectorOffer - :keyword disable_key_based_metadata_write_access: Disable write operations on metadata - resources (databases, containers, throughput) via account keys. - :paramtype disable_key_based_metadata_write_access: bool - :keyword key_vault_key_uri: The URI of the key vault. - :paramtype key_vault_key_uri: str - :keyword default_identity: The default identity for accessing key vault used in features like - customer managed keys. The default identity needs to be explicitly set by the users. It can be - "FirstPartyIdentity", "SystemAssignedIdentity" and more. - :paramtype default_identity: str - :keyword public_network_access: Whether requests from Public Network are allowed. Known values - are: "Enabled", "Disabled", and "SecuredByPerimeter". - :paramtype public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess - :keyword enable_free_tier: Flag to indicate whether Free Tier is enabled. - :paramtype enable_free_tier: bool - :keyword api_properties: API specific properties. Currently, supported only for MongoDB API. - :paramtype api_properties: ~azure.mgmt.cosmosdb.models.ApiProperties - :keyword enable_analytical_storage: Flag to indicate whether to enable storage analytics. - :paramtype enable_analytical_storage: bool - :keyword analytical_storage_configuration: Analytical storage specific properties. - :paramtype analytical_storage_configuration: - ~azure.mgmt.cosmosdb.models.AnalyticalStorageConfiguration - :keyword backup_policy: The object representing the policy for taking backups on an account. - :paramtype backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy - :keyword cors: The CORS policy for the Cosmos DB database account. - :paramtype cors: list[~azure.mgmt.cosmosdb.models.CorsPolicy] - :keyword network_acl_bypass: Indicates what services are allowed to bypass firewall checks. - Known values are: "None" and "AzureServices". - :paramtype network_acl_bypass: str or ~azure.mgmt.cosmosdb.models.NetworkAclBypass - :keyword network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network - Acl Bypass for the Cosmos DB account. - :paramtype network_acl_bypass_resource_ids: list[str] - :keyword diagnostic_log_settings: The Object representing the different Diagnostic log settings - for the Cosmos DB Account. - :paramtype diagnostic_log_settings: ~azure.mgmt.cosmosdb.models.DiagnosticLogSettings - :keyword disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be - used exclusively for authentication. - :paramtype disable_local_auth: bool - :keyword capacity: The object that represents all properties related to capacity enforcement on - an account. - :paramtype capacity: ~azure.mgmt.cosmosdb.models.Capacity - :keyword capacity_mode: Indicates the capacityMode of the Cosmos DB account. Known values are: - "None", "Provisioned", and "Serverless". - :paramtype capacity_mode: str or ~azure.mgmt.cosmosdb.models.CapacityMode - :keyword enable_materialized_views: Flag to indicate whether to enable MaterializedViews on the - Cosmos DB account. - :paramtype enable_materialized_views: bool - :keyword enable_partition_merge: Flag to indicate enabling/disabling of Partition Merge feature - on the account. - :paramtype enable_partition_merge: bool - :keyword enable_burst_capacity: Flag to indicate enabling/disabling of Burst Capacity Preview - feature on the account. - :paramtype enable_burst_capacity: bool - :keyword minimal_tls_version: Indicates the minimum allowed Tls version. The default is Tls - 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. Known values are: - "Tls", "Tls11", and "Tls12". - :paramtype minimal_tls_version: str or ~azure.mgmt.cosmosdb.models.MinimalTlsVersion - :keyword customer_managed_key_status: Indicates the status of the Customer Managed Key feature - on the account. In case there are errors, the property provides troubleshooting guidance. - :paramtype customer_managed_key_status: str - :keyword enable_priority_based_execution: Flag to indicate enabling/disabling of Priority Based - Execution Preview feature on the account. - :paramtype enable_priority_based_execution: bool - :keyword default_priority_level: Enum to indicate default Priority Level of request for - Priority Based Execution. Known values are: "High" and "Low". - :paramtype default_priority_level: str or ~azure.mgmt.cosmosdb.models.DefaultPriorityLevel - :keyword enable_per_region_per_partition_autoscale: Flag to indicate enabling/disabling of - Per-Region Per-partition autoscale Preview feature on the account. - :paramtype enable_per_region_per_partition_autoscale: bool - """ - super().__init__(**kwargs) - self.tags = tags - self.location = location - self.identity = identity - self.consistency_policy = consistency_policy - self.locations = locations - self.ip_rules = ip_rules - self.is_virtual_network_filter_enabled = is_virtual_network_filter_enabled - self.enable_automatic_failover = enable_automatic_failover - self.capabilities = capabilities - self.virtual_network_rules = virtual_network_rules - self.enable_multiple_write_locations = enable_multiple_write_locations - self.enable_cassandra_connector = enable_cassandra_connector - self.connector_offer = connector_offer - self.disable_key_based_metadata_write_access = disable_key_based_metadata_write_access - self.key_vault_key_uri = key_vault_key_uri - self.default_identity = default_identity - self.public_network_access = public_network_access - self.enable_free_tier = enable_free_tier - self.api_properties = api_properties - self.enable_analytical_storage = enable_analytical_storage - self.analytical_storage_configuration = analytical_storage_configuration - self.backup_policy = backup_policy - self.cors = cors - self.network_acl_bypass = network_acl_bypass - self.network_acl_bypass_resource_ids = network_acl_bypass_resource_ids - self.diagnostic_log_settings = diagnostic_log_settings - self.disable_local_auth = disable_local_auth - self.capacity = capacity - self.capacity_mode = capacity_mode - self.enable_materialized_views = enable_materialized_views - self.keys_metadata = None - self.enable_partition_merge = enable_partition_merge - self.enable_burst_capacity = enable_burst_capacity - self.minimal_tls_version = minimal_tls_version - self.customer_managed_key_status = customer_managed_key_status - self.enable_priority_based_execution = enable_priority_based_execution - self.default_priority_level = default_priority_level - self.enable_per_region_per_partition_autoscale = enable_per_region_per_partition_autoscale - - -class DatabaseRestoreResource(_serialization.Model): - """Specific Databases to restore. - - :ivar database_name: The name of the database available for restore. - :vartype database_name: str - :ivar collection_names: The names of the collections available for restore. - :vartype collection_names: list[str] - """ - - _attribute_map = { - "database_name": {"key": "databaseName", "type": "str"}, - "collection_names": {"key": "collectionNames", "type": "[str]"}, - } - - def __init__( - self, *, database_name: Optional[str] = None, collection_names: Optional[List[str]] = None, **kwargs: Any - ) -> None: - """ - :keyword database_name: The name of the database available for restore. - :paramtype database_name: str - :keyword collection_names: The names of the collections available for restore. - :paramtype collection_names: list[str] - """ - super().__init__(**kwargs) - self.database_name = database_name - self.collection_names = collection_names - - -class DataCenterResource(ARMProxyResource): - """A managed Cassandra data center. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The unique resource identifier of the database account. - :vartype id: str - :ivar name: The name of the database account. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar properties: Properties of a managed Cassandra data center. - :vartype properties: ~azure.mgmt.cosmosdb.models.DataCenterResourceProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "properties": {"key": "properties", "type": "DataCenterResourceProperties"}, - } - - def __init__(self, *, properties: Optional["_models.DataCenterResourceProperties"] = None, **kwargs: Any) -> None: - """ - :keyword properties: Properties of a managed Cassandra data center. - :paramtype properties: ~azure.mgmt.cosmosdb.models.DataCenterResourceProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class DataCenterResourceProperties(_serialization.Model): - """Properties of a managed Cassandra data center. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provisioning_state: The status of the resource at the time the operation was called. - Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.cosmosdb.models.ManagedCassandraProvisioningState - :ivar data_center_location: The region this data center should be created in. - :vartype data_center_location: str - :ivar delegated_subnet_id: Resource id of a subnet the nodes in this data center should have - their network interfaces connected to. The subnet must be in the same region specified in - 'dataCenterLocation' and must be able to route to the subnet specified in the cluster's - 'delegatedManagementSubnetId' property. This resource id will be of the form - '/subscriptions/:code:``/resourceGroups/:code:``/providers/Microsoft.Network/virtualNetworks/:code:``/subnets/:code:``'. - :vartype delegated_subnet_id: str - :ivar node_count: The number of nodes the data center should have. This is the desired number. - After it is set, it may take some time for the data center to be scaled to match. To monitor - the number of nodes and their status, use the fetchNodeStatus method on the cluster. - :vartype node_count: int - :ivar seed_nodes: IP addresses for seed nodes in this data center. This is for reference. - Generally you will want to use the seedNodes property on the cluster, which aggregates the seed - nodes from all data centers in the cluster. - :vartype seed_nodes: list[~azure.mgmt.cosmosdb.models.SeedNode] - :ivar base64_encoded_cassandra_yaml_fragment: A fragment of a cassandra.yaml configuration file - to be included in the cassandra.yaml for all nodes in this data center. The fragment should be - Base64 encoded, and only a subset of keys are allowed. - :vartype base64_encoded_cassandra_yaml_fragment: str - :ivar managed_disk_customer_key_uri: Key uri to use for encryption of managed disks. Ensure the - system assigned identity of the cluster has been assigned appropriate permissions(key - get/wrap/unwrap permissions) on the key. - :vartype managed_disk_customer_key_uri: str - :ivar backup_storage_customer_key_uri: Indicates the Key Uri of the customer key to use for - encryption of the backup storage account. - :vartype backup_storage_customer_key_uri: str - :ivar sku: Virtual Machine SKU used for data centers. Default value is Standard_DS14_v2. - :vartype sku: str - :ivar disk_sku: Disk SKU used for data centers. Default value is P30. - :vartype disk_sku: str - :ivar disk_capacity: Number of disks attached to each node. Default is 4. - :vartype disk_capacity: int - :ivar availability_zone: If the data center has Availability Zone support, apply it to the - Virtual Machine ScaleSet that host the cassandra data center virtual machines. - :vartype availability_zone: bool - :ivar authentication_method_ldap_properties: Ldap authentication method properties. This - feature is in preview. - :vartype authentication_method_ldap_properties: - ~azure.mgmt.cosmosdb.models.AuthenticationMethodLdapProperties - :ivar deallocated: Whether the data center has been deallocated. - :vartype deallocated: bool - :ivar provision_error: Error related to resource provisioning. - :vartype provision_error: ~azure.mgmt.cosmosdb.models.CassandraError - :ivar private_endpoint_ip_address: Ip of the VPN Endpoint for this data center. - :vartype private_endpoint_ip_address: str - """ - - _validation = { - "seed_nodes": {"readonly": True}, - } - - _attribute_map = { - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "data_center_location": {"key": "dataCenterLocation", "type": "str"}, - "delegated_subnet_id": {"key": "delegatedSubnetId", "type": "str"}, - "node_count": {"key": "nodeCount", "type": "int"}, - "seed_nodes": {"key": "seedNodes", "type": "[SeedNode]"}, - "base64_encoded_cassandra_yaml_fragment": {"key": "base64EncodedCassandraYamlFragment", "type": "str"}, - "managed_disk_customer_key_uri": {"key": "managedDiskCustomerKeyUri", "type": "str"}, - "backup_storage_customer_key_uri": {"key": "backupStorageCustomerKeyUri", "type": "str"}, - "sku": {"key": "sku", "type": "str"}, - "disk_sku": {"key": "diskSku", "type": "str"}, - "disk_capacity": {"key": "diskCapacity", "type": "int"}, - "availability_zone": {"key": "availabilityZone", "type": "bool"}, - "authentication_method_ldap_properties": { - "key": "authenticationMethodLdapProperties", - "type": "AuthenticationMethodLdapProperties", - }, - "deallocated": {"key": "deallocated", "type": "bool"}, - "provision_error": {"key": "provisionError", "type": "CassandraError"}, - "private_endpoint_ip_address": {"key": "privateEndpointIpAddress", "type": "str"}, - } - - def __init__( - self, - *, - provisioning_state: Optional[Union[str, "_models.ManagedCassandraProvisioningState"]] = None, - data_center_location: Optional[str] = None, - delegated_subnet_id: Optional[str] = None, - node_count: Optional[int] = None, - base64_encoded_cassandra_yaml_fragment: Optional[str] = None, - managed_disk_customer_key_uri: Optional[str] = None, - backup_storage_customer_key_uri: Optional[str] = None, - sku: Optional[str] = None, - disk_sku: Optional[str] = None, - disk_capacity: Optional[int] = None, - availability_zone: Optional[bool] = None, - authentication_method_ldap_properties: Optional["_models.AuthenticationMethodLdapProperties"] = None, - deallocated: Optional[bool] = None, - provision_error: Optional["_models.CassandraError"] = None, - private_endpoint_ip_address: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword provisioning_state: The status of the resource at the time the operation was called. - Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and "Canceled". - :paramtype provisioning_state: str or - ~azure.mgmt.cosmosdb.models.ManagedCassandraProvisioningState - :keyword data_center_location: The region this data center should be created in. - :paramtype data_center_location: str - :keyword delegated_subnet_id: Resource id of a subnet the nodes in this data center should have - their network interfaces connected to. The subnet must be in the same region specified in - 'dataCenterLocation' and must be able to route to the subnet specified in the cluster's - 'delegatedManagementSubnetId' property. This resource id will be of the form - '/subscriptions/:code:``/resourceGroups/:code:``/providers/Microsoft.Network/virtualNetworks/:code:``/subnets/:code:``'. - :paramtype delegated_subnet_id: str - :keyword node_count: The number of nodes the data center should have. This is the desired - number. After it is set, it may take some time for the data center to be scaled to match. To - monitor the number of nodes and their status, use the fetchNodeStatus method on the cluster. - :paramtype node_count: int - :keyword base64_encoded_cassandra_yaml_fragment: A fragment of a cassandra.yaml configuration - file to be included in the cassandra.yaml for all nodes in this data center. The fragment - should be Base64 encoded, and only a subset of keys are allowed. - :paramtype base64_encoded_cassandra_yaml_fragment: str - :keyword managed_disk_customer_key_uri: Key uri to use for encryption of managed disks. Ensure - the system assigned identity of the cluster has been assigned appropriate permissions(key - get/wrap/unwrap permissions) on the key. - :paramtype managed_disk_customer_key_uri: str - :keyword backup_storage_customer_key_uri: Indicates the Key Uri of the customer key to use for - encryption of the backup storage account. - :paramtype backup_storage_customer_key_uri: str - :keyword sku: Virtual Machine SKU used for data centers. Default value is Standard_DS14_v2. - :paramtype sku: str - :keyword disk_sku: Disk SKU used for data centers. Default value is P30. - :paramtype disk_sku: str - :keyword disk_capacity: Number of disks attached to each node. Default is 4. - :paramtype disk_capacity: int - :keyword availability_zone: If the data center has Availability Zone support, apply it to the - Virtual Machine ScaleSet that host the cassandra data center virtual machines. - :paramtype availability_zone: bool - :keyword authentication_method_ldap_properties: Ldap authentication method properties. This - feature is in preview. - :paramtype authentication_method_ldap_properties: - ~azure.mgmt.cosmosdb.models.AuthenticationMethodLdapProperties - :keyword deallocated: Whether the data center has been deallocated. - :paramtype deallocated: bool - :keyword provision_error: Error related to resource provisioning. - :paramtype provision_error: ~azure.mgmt.cosmosdb.models.CassandraError - :keyword private_endpoint_ip_address: Ip of the VPN Endpoint for this data center. - :paramtype private_endpoint_ip_address: str - """ - super().__init__(**kwargs) - self.provisioning_state = provisioning_state - self.data_center_location = data_center_location - self.delegated_subnet_id = delegated_subnet_id - self.node_count = node_count - self.seed_nodes = None - self.base64_encoded_cassandra_yaml_fragment = base64_encoded_cassandra_yaml_fragment - self.managed_disk_customer_key_uri = managed_disk_customer_key_uri - self.backup_storage_customer_key_uri = backup_storage_customer_key_uri - self.sku = sku - self.disk_sku = disk_sku - self.disk_capacity = disk_capacity - self.availability_zone = availability_zone - self.authentication_method_ldap_properties = authentication_method_ldap_properties - self.deallocated = deallocated - self.provision_error = provision_error - self.private_endpoint_ip_address = private_endpoint_ip_address - - -class DataTransferJobFeedResults(_serialization.Model): - """The List operation response, that contains the Data Transfer jobs and their properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of Data Transfer jobs and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.DataTransferJobGetResults] - :ivar next_link: URL to get the next set of Data Transfer job list results if there are any. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DataTransferJobGetResults]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class DataTransferJobGetResults(ARMProxyResource): - """A Cosmos DB Data Transfer Job. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The unique resource identifier of the database account. - :vartype id: str - :ivar name: The name of the database account. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar job_name: Job Name. - :vartype job_name: str - :ivar source: Source DataStore details. - :vartype source: ~azure.mgmt.cosmosdb.models.DataTransferDataSourceSink - :ivar destination: Destination DataStore details. - :vartype destination: ~azure.mgmt.cosmosdb.models.DataTransferDataSourceSink - :ivar status: Job Status. - :vartype status: str - :ivar processed_count: Processed Count. - :vartype processed_count: int - :ivar total_count: Total Count. - :vartype total_count: int - :ivar last_updated_utc_time: Last Updated Time (ISO-8601 format). - :vartype last_updated_utc_time: ~datetime.datetime - :ivar worker_count: Worker count. - :vartype worker_count: int - :ivar error: Error response for Faulted job. - :vartype error: ~azure.mgmt.cosmosdb.models.ErrorResponseAutoGenerated - :ivar duration: Total Duration of Job. - :vartype duration: str - :ivar mode: Mode of job execution. Known values are: "Offline" and "Online". - :vartype mode: str or ~azure.mgmt.cosmosdb.models.DataTransferJobMode - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "job_name": {"readonly": True}, - "status": {"readonly": True}, - "processed_count": {"readonly": True}, - "total_count": {"readonly": True}, - "last_updated_utc_time": {"readonly": True}, - "worker_count": {"minimum": 0}, - "error": {"readonly": True}, - "duration": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "job_name": {"key": "properties.jobName", "type": "str"}, - "source": {"key": "properties.source", "type": "DataTransferDataSourceSink"}, - "destination": {"key": "properties.destination", "type": "DataTransferDataSourceSink"}, - "status": {"key": "properties.status", "type": "str"}, - "processed_count": {"key": "properties.processedCount", "type": "int"}, - "total_count": {"key": "properties.totalCount", "type": "int"}, - "last_updated_utc_time": {"key": "properties.lastUpdatedUtcTime", "type": "iso-8601"}, - "worker_count": {"key": "properties.workerCount", "type": "int"}, - "error": {"key": "properties.error", "type": "ErrorResponseAutoGenerated"}, - "duration": {"key": "properties.duration", "type": "str"}, - "mode": {"key": "properties.mode", "type": "str"}, - } - - def __init__( - self, - *, - source: Optional["_models.DataTransferDataSourceSink"] = None, - destination: Optional["_models.DataTransferDataSourceSink"] = None, - worker_count: Optional[int] = None, - mode: Optional[Union[str, "_models.DataTransferJobMode"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword source: Source DataStore details. - :paramtype source: ~azure.mgmt.cosmosdb.models.DataTransferDataSourceSink - :keyword destination: Destination DataStore details. - :paramtype destination: ~azure.mgmt.cosmosdb.models.DataTransferDataSourceSink - :keyword worker_count: Worker count. - :paramtype worker_count: int - :keyword mode: Mode of job execution. Known values are: "Offline" and "Online". - :paramtype mode: str or ~azure.mgmt.cosmosdb.models.DataTransferJobMode - """ - super().__init__(**kwargs) - self.job_name = None - self.source = source - self.destination = destination - self.status = None - self.processed_count = None - self.total_count = None - self.last_updated_utc_time = None - self.worker_count = worker_count - self.error = None - self.duration = None - self.mode = mode - - -class DataTransferJobProperties(_serialization.Model): - """The properties of a DataTransfer Job. - - 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 job_name: Job Name. - :vartype job_name: str - :ivar source: Source DataStore details. Required. - :vartype source: ~azure.mgmt.cosmosdb.models.DataTransferDataSourceSink - :ivar destination: Destination DataStore details. Required. - :vartype destination: ~azure.mgmt.cosmosdb.models.DataTransferDataSourceSink - :ivar status: Job Status. - :vartype status: str - :ivar processed_count: Processed Count. - :vartype processed_count: int - :ivar total_count: Total Count. - :vartype total_count: int - :ivar last_updated_utc_time: Last Updated Time (ISO-8601 format). - :vartype last_updated_utc_time: ~datetime.datetime - :ivar worker_count: Worker count. - :vartype worker_count: int - :ivar error: Error response for Faulted job. - :vartype error: ~azure.mgmt.cosmosdb.models.ErrorResponseAutoGenerated - :ivar duration: Total Duration of Job. - :vartype duration: str - :ivar mode: Mode of job execution. Known values are: "Offline" and "Online". - :vartype mode: str or ~azure.mgmt.cosmosdb.models.DataTransferJobMode - """ - - _validation = { - "job_name": {"readonly": True}, - "source": {"required": True}, - "destination": {"required": True}, - "status": {"readonly": True}, - "processed_count": {"readonly": True}, - "total_count": {"readonly": True}, - "last_updated_utc_time": {"readonly": True}, - "worker_count": {"minimum": 0}, - "error": {"readonly": True}, - "duration": {"readonly": True}, - } - - _attribute_map = { - "job_name": {"key": "jobName", "type": "str"}, - "source": {"key": "source", "type": "DataTransferDataSourceSink"}, - "destination": {"key": "destination", "type": "DataTransferDataSourceSink"}, - "status": {"key": "status", "type": "str"}, - "processed_count": {"key": "processedCount", "type": "int"}, - "total_count": {"key": "totalCount", "type": "int"}, - "last_updated_utc_time": {"key": "lastUpdatedUtcTime", "type": "iso-8601"}, - "worker_count": {"key": "workerCount", "type": "int"}, - "error": {"key": "error", "type": "ErrorResponseAutoGenerated"}, - "duration": {"key": "duration", "type": "str"}, - "mode": {"key": "mode", "type": "str"}, - } - - def __init__( - self, - *, - source: "_models.DataTransferDataSourceSink", - destination: "_models.DataTransferDataSourceSink", - worker_count: Optional[int] = None, - mode: Optional[Union[str, "_models.DataTransferJobMode"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword source: Source DataStore details. Required. - :paramtype source: ~azure.mgmt.cosmosdb.models.DataTransferDataSourceSink - :keyword destination: Destination DataStore details. Required. - :paramtype destination: ~azure.mgmt.cosmosdb.models.DataTransferDataSourceSink - :keyword worker_count: Worker count. - :paramtype worker_count: int - :keyword mode: Mode of job execution. Known values are: "Offline" and "Online". - :paramtype mode: str or ~azure.mgmt.cosmosdb.models.DataTransferJobMode - """ - super().__init__(**kwargs) - self.job_name = None - self.source = source - self.destination = destination - self.status = None - self.processed_count = None - self.total_count = None - self.last_updated_utc_time = None - self.worker_count = worker_count - self.error = None - self.duration = None - self.mode = mode - - -class RegionalServiceResource(_serialization.Model): - """Resource for a regional service location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The regional service name. - :vartype name: str - :ivar location: The location name. - :vartype location: str - :ivar status: Describes the status of a service. Known values are: "Creating", "Running", - "Updating", "Deleting", "Error", and "Stopped". - :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus - """ - - _validation = { - "name": {"readonly": True}, - "location": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "status": {"key": "status", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.name = None - self.location = None - self.status = None - - -class DataTransferRegionalServiceResource(RegionalServiceResource): - """Resource for a regional service location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The regional service name. - :vartype name: str - :ivar location: The location name. - :vartype location: str - :ivar status: Describes the status of a service. Known values are: "Creating", "Running", - "Updating", "Deleting", "Error", and "Stopped". - :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus - """ - - -class DataTransferServiceResource(_serialization.Model): - """Describes the service response property. - - :ivar properties: Properties for DataTransferServiceResource. - :vartype properties: ~azure.mgmt.cosmosdb.models.DataTransferServiceResourceProperties - """ - - _attribute_map = { - "properties": {"key": "properties", "type": "DataTransferServiceResourceProperties"}, - } - - def __init__( - self, *, properties: Optional["_models.DataTransferServiceResourceProperties"] = None, **kwargs: Any - ) -> None: - """ - :keyword properties: Properties for DataTransferServiceResource. - :paramtype properties: ~azure.mgmt.cosmosdb.models.DataTransferServiceResourceProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class ServiceResourceCreateUpdateProperties(_serialization.Model): - """Properties in ServiceResourceCreateUpdateParameters. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - DataTransferServiceResourceCreateUpdateProperties, - GraphAPIComputeServiceResourceCreateUpdateProperties, - MaterializedViewsBuilderServiceResourceCreateUpdateProperties, - SqlDedicatedGatewayServiceResourceCreateUpdateProperties - - All required parameters must be populated in order to send to server. - - :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", - "Cosmos.D8s", and "Cosmos.D16s". - :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize - :ivar instance_count: Instance count for the service. - :vartype instance_count: int - :ivar service_type: ServiceType for the service. Required. Known values are: - "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". - :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType - """ - - _validation = { - "instance_count": {"minimum": 0}, - "service_type": {"required": True}, - } - - _attribute_map = { - "instance_size": {"key": "instanceSize", "type": "str"}, - "instance_count": {"key": "instanceCount", "type": "int"}, - "service_type": {"key": "serviceType", "type": "str"}, - } - - _subtype_map = { - "service_type": { - "DataTransfer": "DataTransferServiceResourceCreateUpdateProperties", - "GraphAPICompute": "GraphAPIComputeServiceResourceCreateUpdateProperties", - "MaterializedViewsBuilder": "MaterializedViewsBuilderServiceResourceCreateUpdateProperties", - "SqlDedicatedGateway": "SqlDedicatedGatewayServiceResourceCreateUpdateProperties", - } - } - - def __init__( - self, - *, - instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, - instance_count: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", - "Cosmos.D8s", and "Cosmos.D16s". - :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize - :keyword instance_count: Instance count for the service. - :paramtype instance_count: int - """ - super().__init__(**kwargs) - self.instance_size = instance_size - self.instance_count = instance_count - self.service_type: Optional[str] = None - - -class DataTransferServiceResourceCreateUpdateProperties( - ServiceResourceCreateUpdateProperties -): # pylint: disable=name-too-long - """Properties for Create or Update request for DataTransferServiceResource. - - All required parameters must be populated in order to send to server. - - :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", - "Cosmos.D8s", and "Cosmos.D16s". - :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize - :ivar instance_count: Instance count for the service. - :vartype instance_count: int - :ivar service_type: ServiceType for the service. Required. Known values are: - "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". - :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType - """ - - _validation = { - "instance_count": {"minimum": 0}, - "service_type": {"required": True}, - } - - _attribute_map = { - "instance_size": {"key": "instanceSize", "type": "str"}, - "instance_count": {"key": "instanceCount", "type": "int"}, - "service_type": {"key": "serviceType", "type": "str"}, - } - - def __init__( - self, - *, - instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, - instance_count: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", - "Cosmos.D8s", and "Cosmos.D16s". - :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize - :keyword instance_count: Instance count for the service. - :paramtype instance_count: int - """ - super().__init__(instance_size=instance_size, instance_count=instance_count, **kwargs) - self.service_type: str = "DataTransfer" - - -class ServiceResourceProperties(_serialization.Model): - """Services response resource. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - DataTransferServiceResourceProperties, GraphAPIComputeServiceResourceProperties, - MaterializedViewsBuilderServiceResourceProperties, SqlDedicatedGatewayServiceResourceProperties - - 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 additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar creation_time: Time of the last state change (ISO-8601 format). - :vartype creation_time: ~datetime.datetime - :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", - "Cosmos.D8s", and "Cosmos.D16s". - :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize - :ivar instance_count: Instance count for the service. - :vartype instance_count: int - :ivar service_type: ServiceType for the service. Required. Known values are: - "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". - :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType - :ivar status: Describes the status of a service. Known values are: "Creating", "Running", - "Updating", "Deleting", "Error", and "Stopped". - :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus - """ - - _validation = { - "creation_time": {"readonly": True}, - "instance_count": {"minimum": 0}, - "service_type": {"required": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "additional_properties": {"key": "", "type": "{object}"}, - "creation_time": {"key": "creationTime", "type": "iso-8601"}, - "instance_size": {"key": "instanceSize", "type": "str"}, - "instance_count": {"key": "instanceCount", "type": "int"}, - "service_type": {"key": "serviceType", "type": "str"}, - "status": {"key": "status", "type": "str"}, - } - - _subtype_map = { - "service_type": { - "DataTransfer": "DataTransferServiceResourceProperties", - "GraphAPICompute": "GraphAPIComputeServiceResourceProperties", - "MaterializedViewsBuilder": "MaterializedViewsBuilderServiceResourceProperties", - "SqlDedicatedGateway": "SqlDedicatedGatewayServiceResourceProperties", - } - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, - instance_count: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", - "Cosmos.D8s", and "Cosmos.D16s". - :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize - :keyword instance_count: Instance count for the service. - :paramtype instance_count: int - """ - super().__init__(**kwargs) - self.additional_properties = additional_properties - self.creation_time = None - self.instance_size = instance_size - self.instance_count = instance_count - self.service_type: Optional[str] = None - self.status = None - - -class DataTransferServiceResourceProperties(ServiceResourceProperties): - """Properties for DataTransferServiceResource. - - 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 additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar creation_time: Time of the last state change (ISO-8601 format). - :vartype creation_time: ~datetime.datetime - :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", - "Cosmos.D8s", and "Cosmos.D16s". - :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize - :ivar instance_count: Instance count for the service. - :vartype instance_count: int - :ivar service_type: ServiceType for the service. Required. Known values are: - "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". - :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType - :ivar status: Describes the status of a service. Known values are: "Creating", "Running", - "Updating", "Deleting", "Error", and "Stopped". - :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus - :ivar locations: An array that contains all of the locations for the service. - :vartype locations: list[~azure.mgmt.cosmosdb.models.DataTransferRegionalServiceResource] + :ivar provisioning_state: The status of the resource at the time the operation was called. + Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and "Canceled". + :vartype provisioning_state: str or + ~azure.mgmt.cosmosdb.models.ManagedCassandraProvisioningState + :ivar restore_from_backup_id: To create an empty cluster, omit this field or set it to null. To + restore a backup into a new cluster, set this field to the resource id of the backup. + :vartype restore_from_backup_id: str + :ivar delegated_management_subnet_id: Resource id of a subnet that this cluster's management + service should have its network interface attached to. The subnet must be routable to all + subnets that will be delegated to data centers. The resource id must be of the form + '/subscriptions/\\ :code:``/resourceGroups/\\ :code:``/providers/Microsoft.Network/virtualNetworks/\\ :code:``/subnets/\\ + :code:``'. + :vartype delegated_management_subnet_id: str + :ivar cassandra_version: Which version of Cassandra should this cluster converge to running + (e.g., 3.11). When updated, the cluster may take some time to migrate to the new version. + :vartype cassandra_version: str + :ivar cluster_name_override: If you need to set the clusterName property in cassandra.yaml to + something besides the resource name of the cluster, set the value to use on this property. + :vartype cluster_name_override: str + :ivar authentication_method: Which authentication method Cassandra should use to authenticate + clients. 'None' turns off authentication, so should not be used except in emergencies. + 'Cassandra' is the default password based authentication. The default is 'Cassandra'. Known + values are: "None", "Cassandra", and "Ldap". + :vartype authentication_method: str or ~azure.mgmt.cosmosdb.models.AuthenticationMethod + :ivar initial_cassandra_admin_password: Initial password for clients connecting as admin to the + cluster. Should be changed after cluster creation. Returns null on GET. This field only applies + when the authenticationMethod field is 'Cassandra'. + :vartype initial_cassandra_admin_password: str + :ivar prometheus_endpoint: Hostname or IP address where the Prometheus endpoint containing data + about the managed Cassandra nodes can be reached. + :vartype prometheus_endpoint: ~azure.mgmt.cosmosdb.models.SeedNode + :ivar repair_enabled: Should automatic repairs run on this cluster? If omitted, this is true, + and should stay true unless you are running a hybrid cluster where you are already doing your + own repairs. + :vartype repair_enabled: bool + :ivar client_certificates: List of TLS certificates used to authorize clients connecting to the + cluster. All connections are TLS encrypted whether clientCertificates is set or not, but if + clientCertificates is set, the managed Cassandra cluster will reject all connections not + bearing a TLS client certificate that can be validated from one or more of the public + certificates in this property. + :vartype client_certificates: list[~azure.mgmt.cosmosdb.models.Certificate] + :ivar external_gossip_certificates: List of TLS certificates used to authorize gossip from + unmanaged data centers. The TLS certificates of all nodes in unmanaged data centers must be + verifiable using one of the certificates provided in this property. + :vartype external_gossip_certificates: list[~azure.mgmt.cosmosdb.models.Certificate] + :ivar gossip_certificates: List of TLS certificates that unmanaged nodes must trust for gossip + with managed nodes. All managed nodes will present TLS client certificates that are verifiable + using one of the certificates provided in this property. + :vartype gossip_certificates: list[~azure.mgmt.cosmosdb.models.Certificate] + :ivar external_seed_nodes: List of IP addresses of seed nodes in unmanaged data centers. These + will be added to the seed node lists of all managed nodes. + :vartype external_seed_nodes: list[~azure.mgmt.cosmosdb.models.SeedNode] + :ivar seed_nodes: List of IP addresses of seed nodes in the managed data centers. These should + be added to the seed node lists of all unmanaged nodes. + :vartype seed_nodes: list[~azure.mgmt.cosmosdb.models.SeedNode] + :ivar hours_between_backups: (Deprecated) Number of hours to wait between taking a backup of + the cluster. + :vartype hours_between_backups: int + :ivar deallocated: Whether the cluster and associated data centers has been deallocated. + :vartype deallocated: bool + :ivar cassandra_audit_logging_enabled: Whether Cassandra audit logging is enabled. + :vartype cassandra_audit_logging_enabled: bool + :ivar provision_error: Error related to resource provisioning. + :vartype provision_error: ~azure.mgmt.cosmosdb.models.CassandraError + :ivar azure_connection_method: How to connect to the azure services needed for running the + cluster. Known values are: "None" and "VPN". + :vartype azure_connection_method: str or ~azure.mgmt.cosmosdb.models.AzureConnectionType + :ivar private_link_resource_id: If the Connection Method is VPN, this is the Id of the private + link resource that the datacenters need to connect to. + :vartype private_link_resource_id: str """ _validation = { - "creation_time": {"readonly": True}, - "instance_count": {"minimum": 0}, - "service_type": {"required": True}, - "status": {"readonly": True}, - "locations": {"readonly": True}, + "gossip_certificates": {"readonly": True}, + "seed_nodes": {"readonly": True}, + "private_link_resource_id": {"readonly": True}, } _attribute_map = { - "additional_properties": {"key": "", "type": "{object}"}, - "creation_time": {"key": "creationTime", "type": "iso-8601"}, - "instance_size": {"key": "instanceSize", "type": "str"}, - "instance_count": {"key": "instanceCount", "type": "int"}, - "service_type": {"key": "serviceType", "type": "str"}, - "status": {"key": "status", "type": "str"}, - "locations": {"key": "locations", "type": "[DataTransferRegionalServiceResource]"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "restore_from_backup_id": {"key": "restoreFromBackupId", "type": "str"}, + "delegated_management_subnet_id": {"key": "delegatedManagementSubnetId", "type": "str"}, + "cassandra_version": {"key": "cassandraVersion", "type": "str"}, + "cluster_name_override": {"key": "clusterNameOverride", "type": "str"}, + "authentication_method": {"key": "authenticationMethod", "type": "str"}, + "initial_cassandra_admin_password": {"key": "initialCassandraAdminPassword", "type": "str"}, + "prometheus_endpoint": {"key": "prometheusEndpoint", "type": "SeedNode"}, + "repair_enabled": {"key": "repairEnabled", "type": "bool"}, + "client_certificates": {"key": "clientCertificates", "type": "[Certificate]"}, + "external_gossip_certificates": {"key": "externalGossipCertificates", "type": "[Certificate]"}, + "gossip_certificates": {"key": "gossipCertificates", "type": "[Certificate]"}, + "external_seed_nodes": {"key": "externalSeedNodes", "type": "[SeedNode]"}, + "seed_nodes": {"key": "seedNodes", "type": "[SeedNode]"}, + "hours_between_backups": {"key": "hoursBetweenBackups", "type": "int"}, + "deallocated": {"key": "deallocated", "type": "bool"}, + "cassandra_audit_logging_enabled": {"key": "cassandraAuditLoggingEnabled", "type": "bool"}, + "provision_error": {"key": "provisionError", "type": "CassandraError"}, + "azure_connection_method": {"key": "azureConnectionMethod", "type": "str"}, + "private_link_resource_id": {"key": "privateLinkResourceId", "type": "str"}, } def __init__( self, *, - additional_properties: Optional[Dict[str, Any]] = None, - instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, - instance_count: Optional[int] = None, + provisioning_state: Optional[Union[str, "_models.ManagedCassandraProvisioningState"]] = None, + restore_from_backup_id: Optional[str] = None, + delegated_management_subnet_id: Optional[str] = None, + cassandra_version: Optional[str] = None, + cluster_name_override: Optional[str] = None, + authentication_method: Optional[Union[str, "_models.AuthenticationMethod"]] = None, + initial_cassandra_admin_password: Optional[str] = None, + prometheus_endpoint: Optional["_models.SeedNode"] = None, + repair_enabled: Optional[bool] = None, + client_certificates: Optional[List["_models.Certificate"]] = None, + external_gossip_certificates: Optional[List["_models.Certificate"]] = None, + external_seed_nodes: Optional[List["_models.SeedNode"]] = None, + hours_between_backups: Optional[int] = None, + deallocated: Optional[bool] = None, + cassandra_audit_logging_enabled: Optional[bool] = None, + provision_error: Optional["_models.CassandraError"] = None, + azure_connection_method: Optional[Union[str, "_models.AzureConnectionType"]] = None, **kwargs: Any ) -> None: """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", - "Cosmos.D8s", and "Cosmos.D16s". - :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize - :keyword instance_count: Instance count for the service. - :paramtype instance_count: int + :keyword provisioning_state: The status of the resource at the time the operation was called. + Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and "Canceled". + :paramtype provisioning_state: str or + ~azure.mgmt.cosmosdb.models.ManagedCassandraProvisioningState + :keyword restore_from_backup_id: To create an empty cluster, omit this field or set it to null. + To restore a backup into a new cluster, set this field to the resource id of the backup. + :paramtype restore_from_backup_id: str + :keyword delegated_management_subnet_id: Resource id of a subnet that this cluster's management + service should have its network interface attached to. The subnet must be routable to all + subnets that will be delegated to data centers. The resource id must be of the form + '/subscriptions/\\ :code:``/resourceGroups/\\ :code:``/providers/Microsoft.Network/virtualNetworks/\\ :code:``/subnets/\\ + :code:``'. + :paramtype delegated_management_subnet_id: str + :keyword cassandra_version: Which version of Cassandra should this cluster converge to running + (e.g., 3.11). When updated, the cluster may take some time to migrate to the new version. + :paramtype cassandra_version: str + :keyword cluster_name_override: If you need to set the clusterName property in cassandra.yaml + to something besides the resource name of the cluster, set the value to use on this property. + :paramtype cluster_name_override: str + :keyword authentication_method: Which authentication method Cassandra should use to + authenticate clients. 'None' turns off authentication, so should not be used except in + emergencies. 'Cassandra' is the default password based authentication. The default is + 'Cassandra'. Known values are: "None", "Cassandra", and "Ldap". + :paramtype authentication_method: str or ~azure.mgmt.cosmosdb.models.AuthenticationMethod + :keyword initial_cassandra_admin_password: Initial password for clients connecting as admin to + the cluster. Should be changed after cluster creation. Returns null on GET. This field only + applies when the authenticationMethod field is 'Cassandra'. + :paramtype initial_cassandra_admin_password: str + :keyword prometheus_endpoint: Hostname or IP address where the Prometheus endpoint containing + data about the managed Cassandra nodes can be reached. + :paramtype prometheus_endpoint: ~azure.mgmt.cosmosdb.models.SeedNode + :keyword repair_enabled: Should automatic repairs run on this cluster? If omitted, this is + true, and should stay true unless you are running a hybrid cluster where you are already doing + your own repairs. + :paramtype repair_enabled: bool + :keyword client_certificates: List of TLS certificates used to authorize clients connecting to + the cluster. All connections are TLS encrypted whether clientCertificates is set or not, but if + clientCertificates is set, the managed Cassandra cluster will reject all connections not + bearing a TLS client certificate that can be validated from one or more of the public + certificates in this property. + :paramtype client_certificates: list[~azure.mgmt.cosmosdb.models.Certificate] + :keyword external_gossip_certificates: List of TLS certificates used to authorize gossip from + unmanaged data centers. The TLS certificates of all nodes in unmanaged data centers must be + verifiable using one of the certificates provided in this property. + :paramtype external_gossip_certificates: list[~azure.mgmt.cosmosdb.models.Certificate] + :keyword external_seed_nodes: List of IP addresses of seed nodes in unmanaged data centers. + These will be added to the seed node lists of all managed nodes. + :paramtype external_seed_nodes: list[~azure.mgmt.cosmosdb.models.SeedNode] + :keyword hours_between_backups: (Deprecated) Number of hours to wait between taking a backup of + the cluster. + :paramtype hours_between_backups: int + :keyword deallocated: Whether the cluster and associated data centers has been deallocated. + :paramtype deallocated: bool + :keyword cassandra_audit_logging_enabled: Whether Cassandra audit logging is enabled. + :paramtype cassandra_audit_logging_enabled: bool + :keyword provision_error: Error related to resource provisioning. + :paramtype provision_error: ~azure.mgmt.cosmosdb.models.CassandraError + :keyword azure_connection_method: How to connect to the azure services needed for running the + cluster. Known values are: "None" and "VPN". + :paramtype azure_connection_method: str or ~azure.mgmt.cosmosdb.models.AzureConnectionType """ - super().__init__( - additional_properties=additional_properties, - instance_size=instance_size, - instance_count=instance_count, - **kwargs - ) - self.service_type: str = "DataTransfer" - self.locations = None + super().__init__(**kwargs) + self.provisioning_state = provisioning_state + self.restore_from_backup_id = restore_from_backup_id + self.delegated_management_subnet_id = delegated_management_subnet_id + self.cassandra_version = cassandra_version + self.cluster_name_override = cluster_name_override + self.authentication_method = authentication_method + self.initial_cassandra_admin_password = initial_cassandra_admin_password + self.prometheus_endpoint = prometheus_endpoint + self.repair_enabled = repair_enabled + self.client_certificates = client_certificates + self.external_gossip_certificates = external_gossip_certificates + self.gossip_certificates = None + self.external_seed_nodes = external_seed_nodes + self.seed_nodes = None + self.hours_between_backups = hours_between_backups + self.deallocated = deallocated + self.cassandra_audit_logging_enabled = cassandra_audit_logging_enabled + self.provision_error = provision_error + self.azure_connection_method = azure_connection_method + self.private_link_resource_id = None -class DiagnosticLogSettings(_serialization.Model): - """Indicates what diagnostic log settings are to be enabled. +class Column(_serialization.Model): + """Cosmos DB Cassandra table column. - :ivar enable_full_text_query: Describe the level of detail with which queries are to be logged. - Known values are: "None", "True", and "False". - :vartype enable_full_text_query: str or ~azure.mgmt.cosmosdb.models.EnableFullTextQuery + :ivar name: Name of the Cosmos DB Cassandra table column. + :vartype name: str + :ivar type: Type of the Cosmos DB Cassandra table column. + :vartype type: str """ _attribute_map = { - "enable_full_text_query": {"key": "enableFullTextQuery", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, *, enable_full_text_query: Optional[Union[str, "_models.EnableFullTextQuery"]] = None, **kwargs: Any - ) -> None: + def __init__(self, *, name: Optional[str] = None, type: Optional[str] = None, **kwargs: Any) -> None: """ - :keyword enable_full_text_query: Describe the level of detail with which queries are to be - logged. Known values are: "None", "True", and "False". - :paramtype enable_full_text_query: str or ~azure.mgmt.cosmosdb.models.EnableFullTextQuery + :keyword name: Name of the Cosmos DB Cassandra table column. + :paramtype name: str + :keyword type: Type of the Cosmos DB Cassandra table column. + :paramtype type: str """ super().__init__(**kwargs) - self.enable_full_text_query = enable_full_text_query - + self.name = name + self.type = type -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. +class CommandOutput(_serialization.Model): + """Response of /command api. - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: JSON + :ivar command_output: Output of the command. + :vartype command_output: str """ - _validation = { - "type": {"readonly": True}, - "info": {"readonly": True}, - } - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "info": {"key": "info", "type": "object"}, + "command_output": {"key": "commandOutput", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, command_output: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword command_output: Output of the command. + :paramtype command_output: str + """ super().__init__(**kwargs) - self.type = None - self.info = None + self.command_output = command_output -class ErrorDetail(_serialization.Model): - """The error detail. +class CommandPostBody(_serialization.Model): + """Specification of which command to run where. - 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 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.cosmosdb.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.cosmosdb.models.ErrorAdditionalInfo] + :ivar command: The command which should be run. Required. + :vartype command: str + :ivar arguments: The arguments for the command to be run. + :vartype arguments: dict[str, str] + :ivar host: IP address of the cassandra host to run the command on. Required. + :vartype host: str + :ivar cassandra_stop_start: If true, stops cassandra before executing the command and then + start it again. + :vartype cassandra_stop_start: bool + :ivar readwrite: If true, allows the command to *write* to the cassandra directory, otherwise + read-only. + :vartype readwrite: bool """ _validation = { - "code": {"readonly": True}, - "message": {"readonly": True}, - "target": {"readonly": True}, - "details": {"readonly": True}, - "additional_info": {"readonly": True}, + "command": {"required": True}, + "host": {"required": 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]"}, + "command": {"key": "command", "type": "str"}, + "arguments": {"key": "arguments", "type": "{str}"}, + "host": {"key": "host", "type": "str"}, + "cassandra_stop_start": {"key": "cassandra-stop-start", "type": "bool"}, + "readwrite": {"key": "readwrite", "type": "bool"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + command: str, + host: str, + arguments: Optional[Dict[str, str]] = None, + cassandra_stop_start: Optional[bool] = None, + readwrite: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword command: The command which should be run. Required. + :paramtype command: str + :keyword arguments: The arguments for the command to be run. + :paramtype arguments: dict[str, str] + :keyword host: IP address of the cassandra host to run the command on. Required. + :paramtype host: str + :keyword cassandra_stop_start: If true, stops cassandra before executing the command and then + start it again. + :paramtype cassandra_stop_start: bool + :keyword readwrite: If true, allows the command to *write* to the cassandra directory, + otherwise read-only. + :paramtype readwrite: bool + """ super().__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None + self.command = command + self.arguments = arguments + self.host = host + self.cassandra_stop_start = cassandra_stop_start + self.readwrite = readwrite -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.). +class CompositePath(_serialization.Model): + """CompositePath. - :ivar error: The error object. - :vartype error: ~azure.mgmt.cosmosdb.models.ErrorDetail + :ivar path: The path for which the indexing behavior applies to. Index paths typically start + with root and end with wildcard (/path/*). + :vartype path: str + :ivar order: Sort order for composite paths. Known values are: "ascending" and "descending". + :vartype order: str or ~azure.mgmt.cosmosdb.models.CompositePathSortOrder """ _attribute_map = { - "error": {"key": "error", "type": "ErrorDetail"}, + "path": {"key": "path", "type": "str"}, + "order": {"key": "order", "type": "str"}, } - def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + path: Optional[str] = None, + order: Optional[Union[str, "_models.CompositePathSortOrder"]] = None, + **kwargs: Any + ) -> None: """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.cosmosdb.models.ErrorDetail + :keyword path: The path for which the indexing behavior applies to. Index paths typically start + with root and end with wildcard (/path/*). + :paramtype path: str + :keyword order: Sort order for composite paths. Known values are: "ascending" and "descending". + :paramtype order: str or ~azure.mgmt.cosmosdb.models.CompositePathSortOrder """ super().__init__(**kwargs) - self.error = error + self.path = path + self.order = order -class ErrorResponseAutoGenerated(_serialization.Model): - """Error Response. +class ComputedProperty(_serialization.Model): + """The definition of a computed property. - :ivar code: Error code. - :vartype code: str - :ivar message: Error message indicating why the operation failed. - :vartype message: str + :ivar name: The name of a computed property, for example - "cp_lowerName". + :vartype name: str + :ivar query: The query that evaluates the value for computed property, for example - "SELECT + VALUE LOWER(c.name) FROM c". + :vartype query: str """ _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "query": {"key": "query", "type": "str"}, } - def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None, **kwargs: Any) -> None: + def __init__(self, *, name: Optional[str] = None, query: Optional[str] = None, **kwargs: Any) -> None: """ - :keyword code: Error code. - :paramtype code: str - :keyword message: Error message indicating why the operation failed. - :paramtype message: str + :keyword name: The name of a computed property, for example - "cp_lowerName". + :paramtype name: str + :keyword query: The query that evaluates the value for computed property, for example - "SELECT + VALUE LOWER(c.name) FROM c". + :paramtype query: str """ super().__init__(**kwargs) - self.code = code - self.message = message + self.name = name + self.query = query -class ExcludedPath(_serialization.Model): - """ExcludedPath. +class ConflictResolutionPolicy(_serialization.Model): + """The conflict resolution policy for the container. - :ivar path: The path for which the indexing behavior applies to. Index paths typically start - with root and end with wildcard (/path/*). - :vartype path: str + :ivar mode: Indicates the conflict resolution mode. Known values are: "LastWriterWins" and + "Custom". + :vartype mode: str or ~azure.mgmt.cosmosdb.models.ConflictResolutionMode + :ivar conflict_resolution_path: The conflict resolution path in the case of LastWriterWins + mode. + :vartype conflict_resolution_path: str + :ivar conflict_resolution_procedure: The procedure to resolve conflicts in the case of custom + mode. + :vartype conflict_resolution_procedure: str """ _attribute_map = { - "path": {"key": "path", "type": "str"}, + "mode": {"key": "mode", "type": "str"}, + "conflict_resolution_path": {"key": "conflictResolutionPath", "type": "str"}, + "conflict_resolution_procedure": {"key": "conflictResolutionProcedure", "type": "str"}, } - def __init__(self, *, path: Optional[str] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + mode: Union[str, "_models.ConflictResolutionMode"] = "LastWriterWins", + conflict_resolution_path: Optional[str] = None, + conflict_resolution_procedure: Optional[str] = None, + **kwargs: Any + ) -> None: """ - :keyword path: The path for which the indexing behavior applies to. Index paths typically start - with root and end with wildcard (/path/*). - :paramtype path: str + :keyword mode: Indicates the conflict resolution mode. Known values are: "LastWriterWins" and + "Custom". + :paramtype mode: str or ~azure.mgmt.cosmosdb.models.ConflictResolutionMode + :keyword conflict_resolution_path: The conflict resolution path in the case of LastWriterWins + mode. + :paramtype conflict_resolution_path: str + :keyword conflict_resolution_procedure: The procedure to resolve conflicts in the case of + custom mode. + :paramtype conflict_resolution_procedure: str """ super().__init__(**kwargs) - self.path = path - + self.mode = mode + self.conflict_resolution_path = conflict_resolution_path + self.conflict_resolution_procedure = conflict_resolution_procedure -class FailoverPolicies(_serialization.Model): - """The list of new failover policies for the failover priority change. - All required parameters must be populated in order to send to server. +class ConnectionError(_serialization.Model): + """ConnectionError. - :ivar failover_policies: List of failover policies. Required. - :vartype failover_policies: list[~azure.mgmt.cosmosdb.models.FailoverPolicy] + :ivar connection_state: The kind of connection error that occurred. Known values are: + "Unknown", "OK", "OperatorToDataCenterNetworkError", "DatacenterToDatacenterNetworkError", + "InternalOperatorToDataCenterCertificateError", and "InternalError". + :vartype connection_state: str or ~azure.mgmt.cosmosdb.models.ConnectionState + :ivar i_p_from: The IP of host that originated the failed connection. + :vartype i_p_from: str + :ivar i_p_to: The IP that the connection attempted to reach. + :vartype i_p_to: str + :ivar port: The TCP port the connection was attempted on. + :vartype port: int + :ivar exception: Detailed error message about the failed connection. + :vartype exception: str """ - _validation = { - "failover_policies": {"required": True}, - } - _attribute_map = { - "failover_policies": {"key": "failoverPolicies", "type": "[FailoverPolicy]"}, + "connection_state": {"key": "connectionState", "type": "str"}, + "i_p_from": {"key": "iPFrom", "type": "str"}, + "i_p_to": {"key": "iPTo", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "exception": {"key": "exception", "type": "str"}, } - def __init__(self, *, failover_policies: List["_models.FailoverPolicy"], **kwargs: Any) -> None: + def __init__( + self, + *, + connection_state: Optional[Union[str, "_models.ConnectionState"]] = None, + i_p_from: Optional[str] = None, + i_p_to: Optional[str] = None, + port: Optional[int] = None, + exception: Optional[str] = None, + **kwargs: Any + ) -> None: """ - :keyword failover_policies: List of failover policies. Required. - :paramtype failover_policies: list[~azure.mgmt.cosmosdb.models.FailoverPolicy] + :keyword connection_state: The kind of connection error that occurred. Known values are: + "Unknown", "OK", "OperatorToDataCenterNetworkError", "DatacenterToDatacenterNetworkError", + "InternalOperatorToDataCenterCertificateError", and "InternalError". + :paramtype connection_state: str or ~azure.mgmt.cosmosdb.models.ConnectionState + :keyword i_p_from: The IP of host that originated the failed connection. + :paramtype i_p_from: str + :keyword i_p_to: The IP that the connection attempted to reach. + :paramtype i_p_to: str + :keyword port: The TCP port the connection was attempted on. + :paramtype port: int + :keyword exception: Detailed error message about the failed connection. + :paramtype exception: str """ super().__init__(**kwargs) - self.failover_policies = failover_policies + self.connection_state = connection_state + self.i_p_from = i_p_from + self.i_p_to = i_p_to + self.port = port + self.exception = exception -class FailoverPolicy(_serialization.Model): - """The failover policy for a given region of a database account. +class ConsistencyPolicy(_serialization.Model): + """The consistency policy for the Cosmos DB database account. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to server. - :ivar id: The unique identifier of the region in which the database account replicates to. - Example: <accountName>-<locationName>. - :vartype id: str - :ivar location_name: The name of the region in which the database account exists. - :vartype location_name: str - :ivar failover_priority: The failover priority of the region. A failover priority of 0 - indicates a write region. The maximum value for a failover priority = (total number of regions - - 1). Failover priority values must be unique for each of the regions in which the database - account exists. - :vartype failover_priority: int + :ivar default_consistency_level: The default consistency level and configuration settings of + the Cosmos DB account. Required. Known values are: "Eventual", "Session", "BoundedStaleness", + "Strong", and "ConsistentPrefix". + :vartype default_consistency_level: str or ~azure.mgmt.cosmosdb.models.DefaultConsistencyLevel + :ivar max_staleness_prefix: When used with the Bounded Staleness consistency level, this value + represents the number of stale requests tolerated. Accepted range for this value is 1 – + 2,147,483,647. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. + :vartype max_staleness_prefix: int + :ivar max_interval_in_seconds: When used with the Bounded Staleness consistency level, this + value represents the time amount of staleness (in seconds) tolerated. Accepted range for this + value is 5 - 86400. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. + :vartype max_interval_in_seconds: int """ _validation = { - "id": {"readonly": True}, - "failover_priority": {"minimum": 0}, + "default_consistency_level": {"required": True}, + "max_staleness_prefix": {"maximum": 2147483647, "minimum": 1}, + "max_interval_in_seconds": {"maximum": 86400, "minimum": 5}, } _attribute_map = { - "id": {"key": "id", "type": "str"}, - "location_name": {"key": "locationName", "type": "str"}, - "failover_priority": {"key": "failoverPriority", "type": "int"}, + "default_consistency_level": {"key": "defaultConsistencyLevel", "type": "str"}, + "max_staleness_prefix": {"key": "maxStalenessPrefix", "type": "int"}, + "max_interval_in_seconds": {"key": "maxIntervalInSeconds", "type": "int"}, } def __init__( - self, *, location_name: Optional[str] = None, failover_priority: Optional[int] = None, **kwargs: Any + self, + *, + default_consistency_level: Union[str, "_models.DefaultConsistencyLevel"], + max_staleness_prefix: Optional[int] = None, + max_interval_in_seconds: Optional[int] = None, + **kwargs: Any ) -> None: """ - :keyword location_name: The name of the region in which the database account exists. - :paramtype location_name: str - :keyword failover_priority: The failover priority of the region. A failover priority of 0 - indicates a write region. The maximum value for a failover priority = (total number of regions - - 1). Failover priority values must be unique for each of the regions in which the database - account exists. - :paramtype failover_priority: int + :keyword default_consistency_level: The default consistency level and configuration settings of + the Cosmos DB account. Required. Known values are: "Eventual", "Session", "BoundedStaleness", + "Strong", and "ConsistentPrefix". + :paramtype default_consistency_level: str or + ~azure.mgmt.cosmosdb.models.DefaultConsistencyLevel + :keyword max_staleness_prefix: When used with the Bounded Staleness consistency level, this + value represents the number of stale requests tolerated. Accepted range for this value is 1 – + 2,147,483,647. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. + :paramtype max_staleness_prefix: int + :keyword max_interval_in_seconds: When used with the Bounded Staleness consistency level, this + value represents the time amount of staleness (in seconds) tolerated. Accepted range for this + value is 5 - 86400. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. + :paramtype max_interval_in_seconds: int """ super().__init__(**kwargs) - self.id = None - self.location_name = location_name - self.failover_priority = failover_priority + self.default_consistency_level = default_consistency_level + self.max_staleness_prefix = max_staleness_prefix + self.max_interval_in_seconds = max_interval_in_seconds -class GraphAPIComputeRegionalServiceResource(RegionalServiceResource): - """Resource for a regional service location. +class ContainerPartitionKey(_serialization.Model): + """The configuration of the partition key to be used for partitioning data into multiple + partitions. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: The regional service name. - :vartype name: str - :ivar location: The location name. - :vartype location: str - :ivar status: Describes the status of a service. Known values are: "Creating", "Running", - "Updating", "Deleting", "Error", and "Stopped". - :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus - :ivar graph_api_compute_endpoint: The regional endpoint for GraphAPICompute. - :vartype graph_api_compute_endpoint: str + :ivar paths: List of paths using which data within the container can be partitioned. + :vartype paths: list[str] + :ivar kind: Indicates the kind of algorithm used for partitioning. For MultiHash, multiple + partition keys (upto three maximum) are supported for container create. Known values are: + "Hash", "Range", and "MultiHash". + :vartype kind: str or ~azure.mgmt.cosmosdb.models.PartitionKind + :ivar version: Indicates the version of the partition key definition. + :vartype version: int + :ivar system_key: Indicates if the container is using a system generated partition key. + :vartype system_key: bool """ _validation = { - "name": {"readonly": True}, - "location": {"readonly": True}, - "status": {"readonly": True}, - "graph_api_compute_endpoint": {"readonly": True}, + "version": {"maximum": 2, "minimum": 1}, + "system_key": {"readonly": True}, } _attribute_map = { - "name": {"key": "name", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "status": {"key": "status", "type": "str"}, - "graph_api_compute_endpoint": {"key": "graphApiComputeEndpoint", "type": "str"}, + "paths": {"key": "paths", "type": "[str]"}, + "kind": {"key": "kind", "type": "str"}, + "version": {"key": "version", "type": "int"}, + "system_key": {"key": "systemKey", "type": "bool"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + paths: Optional[List[str]] = None, + kind: Union[str, "_models.PartitionKind"] = "Hash", + version: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword paths: List of paths using which data within the container can be partitioned. + :paramtype paths: list[str] + :keyword kind: Indicates the kind of algorithm used for partitioning. For MultiHash, multiple + partition keys (upto three maximum) are supported for container create. Known values are: + "Hash", "Range", and "MultiHash". + :paramtype kind: str or ~azure.mgmt.cosmosdb.models.PartitionKind + :keyword version: Indicates the version of the partition key definition. + :paramtype version: int + """ super().__init__(**kwargs) - self.graph_api_compute_endpoint = None + self.paths = paths + self.kind = kind + self.version = version + self.system_key = None -class GraphAPIComputeServiceResource(_serialization.Model): - """Describes the service response property for GraphAPICompute. +class ContinuousBackupInformation(_serialization.Model): + """Information about the status of continuous backups. - :ivar properties: Properties for GraphAPIComputeServiceResource. - :vartype properties: ~azure.mgmt.cosmosdb.models.GraphAPIComputeServiceResourceProperties + :ivar latest_restorable_timestamp: The latest restorable timestamp for a resource. + :vartype latest_restorable_timestamp: str """ _attribute_map = { - "properties": {"key": "properties", "type": "GraphAPIComputeServiceResourceProperties"}, + "latest_restorable_timestamp": {"key": "latestRestorableTimestamp", "type": "str"}, } - def __init__( - self, *, properties: Optional["_models.GraphAPIComputeServiceResourceProperties"] = None, **kwargs: Any - ) -> None: + def __init__(self, *, latest_restorable_timestamp: Optional[str] = None, **kwargs: Any) -> None: """ - :keyword properties: Properties for GraphAPIComputeServiceResource. - :paramtype properties: ~azure.mgmt.cosmosdb.models.GraphAPIComputeServiceResourceProperties + :keyword latest_restorable_timestamp: The latest restorable timestamp for a resource. + :paramtype latest_restorable_timestamp: str """ super().__init__(**kwargs) - self.properties = properties - + self.latest_restorable_timestamp = latest_restorable_timestamp -class GraphAPIComputeServiceResourceCreateUpdateProperties( - ServiceResourceCreateUpdateProperties -): # pylint: disable=name-too-long - """Properties for Create or Update request for GraphAPIComputeServiceResource. - All required parameters must be populated in order to send to server. +class ContinuousBackupRestoreLocation(_serialization.Model): + """Properties of the regional restorable account. - :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", - "Cosmos.D8s", and "Cosmos.D16s". - :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize - :ivar instance_count: Instance count for the service. - :vartype instance_count: int - :ivar service_type: ServiceType for the service. Required. Known values are: - "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". - :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType + :ivar location: The name of the continuous backup restore location. + :vartype location: str """ - _validation = { - "instance_count": {"minimum": 0}, - "service_type": {"required": True}, - } - _attribute_map = { - "instance_size": {"key": "instanceSize", "type": "str"}, - "instance_count": {"key": "instanceCount", "type": "int"}, - "service_type": {"key": "serviceType", "type": "str"}, + "location": {"key": "location", "type": "str"}, } - def __init__( - self, - *, - instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, - instance_count: Optional[int] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, location: Optional[str] = None, **kwargs: Any) -> None: """ - :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", - "Cosmos.D8s", and "Cosmos.D16s". - :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize - :keyword instance_count: Instance count for the service. - :paramtype instance_count: int + :keyword location: The name of the continuous backup restore location. + :paramtype location: str """ - super().__init__(instance_size=instance_size, instance_count=instance_count, **kwargs) - self.service_type: str = "GraphAPICompute" - + super().__init__(**kwargs) + self.location = location -class GraphAPIComputeServiceResourceProperties(ServiceResourceProperties): - """Properties for GraphAPIComputeServiceResource. - Variables are only populated by the server, and will be ignored when sending a request. +class ContinuousModeBackupPolicy(BackupPolicy): + """The object representing continuous mode backup policy. All required parameters must be populated in order to send to server. - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar creation_time: Time of the last state change (ISO-8601 format). - :vartype creation_time: ~datetime.datetime - :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", - "Cosmos.D8s", and "Cosmos.D16s". - :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize - :ivar instance_count: Instance count for the service. - :vartype instance_count: int - :ivar service_type: ServiceType for the service. Required. Known values are: - "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". - :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType - :ivar status: Describes the status of a service. Known values are: "Creating", "Running", - "Updating", "Deleting", "Error", and "Stopped". - :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus - :ivar graph_api_compute_endpoint: GraphAPICompute endpoint for the service. - :vartype graph_api_compute_endpoint: str - :ivar locations: An array that contains all of the locations for the service. - :vartype locations: list[~azure.mgmt.cosmosdb.models.GraphAPIComputeRegionalServiceResource] + :ivar type: Describes the mode of backups. Required. Known values are: "Periodic" and + "Continuous". + :vartype type: str or ~azure.mgmt.cosmosdb.models.BackupPolicyType + :ivar migration_state: The object representing the state of the migration between the backup + policies. + :vartype migration_state: ~azure.mgmt.cosmosdb.models.BackupPolicyMigrationState + :ivar continuous_mode_properties: Configuration values for continuous mode backup. + :vartype continuous_mode_properties: ~azure.mgmt.cosmosdb.models.ContinuousModeProperties """ _validation = { - "creation_time": {"readonly": True}, - "instance_count": {"minimum": 0}, - "service_type": {"required": True}, - "status": {"readonly": True}, - "locations": {"readonly": True}, + "type": {"required": True}, } _attribute_map = { - "additional_properties": {"key": "", "type": "{object}"}, - "creation_time": {"key": "creationTime", "type": "iso-8601"}, - "instance_size": {"key": "instanceSize", "type": "str"}, - "instance_count": {"key": "instanceCount", "type": "int"}, - "service_type": {"key": "serviceType", "type": "str"}, - "status": {"key": "status", "type": "str"}, - "graph_api_compute_endpoint": {"key": "graphApiComputeEndpoint", "type": "str"}, - "locations": {"key": "locations", "type": "[GraphAPIComputeRegionalServiceResource]"}, + "type": {"key": "type", "type": "str"}, + "migration_state": {"key": "migrationState", "type": "BackupPolicyMigrationState"}, + "continuous_mode_properties": {"key": "continuousModeProperties", "type": "ContinuousModeProperties"}, } def __init__( self, *, - additional_properties: Optional[Dict[str, Any]] = None, - instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, - instance_count: Optional[int] = None, - graph_api_compute_endpoint: Optional[str] = None, + migration_state: Optional["_models.BackupPolicyMigrationState"] = None, + continuous_mode_properties: Optional["_models.ContinuousModeProperties"] = None, **kwargs: Any ) -> None: """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", - "Cosmos.D8s", and "Cosmos.D16s". - :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize - :keyword instance_count: Instance count for the service. - :paramtype instance_count: int - :keyword graph_api_compute_endpoint: GraphAPICompute endpoint for the service. - :paramtype graph_api_compute_endpoint: str + :keyword migration_state: The object representing the state of the migration between the backup + policies. + :paramtype migration_state: ~azure.mgmt.cosmosdb.models.BackupPolicyMigrationState + :keyword continuous_mode_properties: Configuration values for continuous mode backup. + :paramtype continuous_mode_properties: ~azure.mgmt.cosmosdb.models.ContinuousModeProperties """ - super().__init__( - additional_properties=additional_properties, - instance_size=instance_size, - instance_count=instance_count, - **kwargs - ) - self.service_type: str = "GraphAPICompute" - self.graph_api_compute_endpoint = graph_api_compute_endpoint - self.locations = None - - -class GraphResource(_serialization.Model): - """Cosmos DB Graph resource object. + super().__init__(migration_state=migration_state, **kwargs) + self.type: str = "Continuous" + self.continuous_mode_properties = continuous_mode_properties - All required parameters must be populated in order to send to server. - :ivar id: Name of the Cosmos DB Graph. Required. - :vartype id: str - """ +class ContinuousModeProperties(_serialization.Model): + """Configuration values for periodic mode backup. - _validation = { - "id": {"required": True}, - } + :ivar tier: Enum to indicate type of Continuous backup mode. Known values are: + "Continuous7Days" and "Continuous30Days". + :vartype tier: str or ~azure.mgmt.cosmosdb.models.ContinuousTier + """ _attribute_map = { - "id": {"key": "id", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } - def __init__(self, *, id: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + def __init__(self, *, tier: Optional[Union[str, "_models.ContinuousTier"]] = None, **kwargs: Any) -> None: """ - :keyword id: Name of the Cosmos DB Graph. Required. - :paramtype id: str + :keyword tier: Enum to indicate type of Continuous backup mode. Known values are: + "Continuous7Days" and "Continuous30Days". + :paramtype tier: str or ~azure.mgmt.cosmosdb.models.ContinuousTier """ super().__init__(**kwargs) - self.id = id - + self.tier = tier -class GraphResourceCreateUpdateParameters(ARMResourceProperties): - """Parameters to create and update Cosmos DB Graph resource. - Variables are only populated by the server, and will be ignored when sending a request. +class CorsPolicy(_serialization.Model): + """The CORS policy for the Cosmos DB database account. All required parameters must be populated in order to send to server. - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar location: The location of the resource group to which the resource belongs. - :vartype location: str - :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :ivar resource: The standard JSON format of a Graph resource. Required. - :vartype resource: ~azure.mgmt.cosmosdb.models.GraphResource - :ivar options: A key-value pair of options to be applied for the request. This corresponds to - the headers sent with the request. - :vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions + :ivar allowed_origins: The origin domains that are permitted to make a request against the + service via CORS. Required. + :vartype allowed_origins: str + :ivar allowed_methods: The methods (HTTP request verbs) that the origin domain may use for a + CORS request. + :vartype allowed_methods: str + :ivar allowed_headers: The request headers that the origin domain may specify on the CORS + request. + :vartype allowed_headers: str + :ivar exposed_headers: The response headers that may be sent in the response to the CORS + request and exposed by the browser to the request issuer. + :vartype exposed_headers: str + :ivar max_age_in_seconds: The maximum amount time that a browser should cache the preflight + OPTIONS request. + :vartype max_age_in_seconds: int """ _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "resource": {"required": True}, + "allowed_origins": {"required": True}, + "max_age_in_seconds": {"maximum": 2147483647, "minimum": 1}, } _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "resource": {"key": "properties.resource", "type": "GraphResource"}, - "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, + "allowed_origins": {"key": "allowedOrigins", "type": "str"}, + "allowed_methods": {"key": "allowedMethods", "type": "str"}, + "allowed_headers": {"key": "allowedHeaders", "type": "str"}, + "exposed_headers": {"key": "exposedHeaders", "type": "str"}, + "max_age_in_seconds": {"key": "maxAgeInSeconds", "type": "int"}, } def __init__( self, *, - resource: "_models.GraphResource", - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - options: Optional["_models.CreateUpdateOptions"] = None, + allowed_origins: str, + allowed_methods: Optional[str] = None, + allowed_headers: Optional[str] = None, + exposed_headers: Optional[str] = None, + max_age_in_seconds: Optional[int] = None, **kwargs: Any ) -> None: """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :keyword resource: The standard JSON format of a Graph resource. Required. - :paramtype resource: ~azure.mgmt.cosmosdb.models.GraphResource - :keyword options: A key-value pair of options to be applied for the request. This corresponds - to the headers sent with the request. - :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions + :keyword allowed_origins: The origin domains that are permitted to make a request against the + service via CORS. Required. + :paramtype allowed_origins: str + :keyword allowed_methods: The methods (HTTP request verbs) that the origin domain may use for a + CORS request. + :paramtype allowed_methods: str + :keyword allowed_headers: The request headers that the origin domain may specify on the CORS + request. + :paramtype allowed_headers: str + :keyword exposed_headers: The response headers that may be sent in the response to the CORS + request and exposed by the browser to the request issuer. + :paramtype exposed_headers: str + :keyword max_age_in_seconds: The maximum amount time that a browser should cache the preflight + OPTIONS request. + :paramtype max_age_in_seconds: int """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.resource = resource - self.options = options + super().__init__(**kwargs) + self.allowed_origins = allowed_origins + self.allowed_methods = allowed_methods + self.allowed_headers = allowed_headers + self.exposed_headers = exposed_headers + self.max_age_in_seconds = max_age_in_seconds -class GraphResourceGetPropertiesOptions(OptionsResource): - """GraphResourceGetPropertiesOptions. +class CreateUpdateOptions(_serialization.Model): + """CreateUpdateOptions are a list of key-value pairs that describe the resource. Supported keys + are "If-Match", "If-None-Match", "Session-Token" and "Throughput". - :ivar throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the - ThroughputSetting resource when retrieving offer details. + :ivar throughput: Request Units per second. For example, "throughput": 10000. :vartype throughput: int - :ivar autoscale_settings: Specifies the Autoscale settings. + :ivar autoscale_settings: Specifies the Autoscale settings. Note: Either throughput or + autoscaleSettings is required, but not both. :vartype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings """ + _attribute_map = { + "throughput": {"key": "throughput", "type": "int"}, + "autoscale_settings": {"key": "autoscaleSettings", "type": "AutoscaleSettings"}, + } + + def __init__( + self, + *, + throughput: Optional[int] = None, + autoscale_settings: Optional["_models.AutoscaleSettings"] = None, + **kwargs: Any + ) -> None: + """ + :keyword throughput: Request Units per second. For example, "throughput": 10000. + :paramtype throughput: int + :keyword autoscale_settings: Specifies the Autoscale settings. Note: Either throughput or + autoscaleSettings is required, but not both. + :paramtype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings + """ + super().__init__(**kwargs) + self.throughput = throughput + self.autoscale_settings = autoscale_settings + -class GraphResourceGetPropertiesResource(GraphResource): - """GraphResourceGetPropertiesResource. +class DatabaseAccountConnectionString(_serialization.Model): + """Connection string for the Cosmos DB account. - All required parameters must be populated in order to send to server. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Name of the Cosmos DB Graph. Required. - :vartype id: str + :ivar connection_string: Value of the connection string. + :vartype connection_string: str + :ivar description: Description of the connection string. + :vartype description: str + :ivar key_kind: Kind of the connection string key. Known values are: "Primary", "Secondary", + "PrimaryReadonly", and "SecondaryReadonly". + :vartype key_kind: str or ~azure.mgmt.cosmosdb.models.Kind + :ivar type: Type of the connection string. Known values are: "Sql", "Table", "MongoDB", + "Cassandra", "CassandraConnectorMetadata", "Gremlin", "SqlDedicatedGateway", "GremlinV2", and + "Undefined". + :vartype type: str or ~azure.mgmt.cosmosdb.models.Type """ + _validation = { + "connection_string": {"readonly": True}, + "description": {"readonly": True}, + "key_kind": {"readonly": True}, + "type": {"readonly": True}, + } + + _attribute_map = { + "connection_string": {"key": "connectionString", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "key_kind": {"key": "keyKind", "type": "str"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.connection_string = None + self.description = None + self.key_kind = None + self.type = None + -class GraphResourceGetResults(ARMResourceProperties): - """An Azure Cosmos DB Graph resource. +class DatabaseAccountCreateUpdateParameters(ARMResourceProperties): + """Parameters to create and update Cosmos DB database accounts. Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to server. + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str :ivar name: The name of the ARM resource. @@ -6957,18 +2866,112 @@ class GraphResourceGetResults(ARMResourceProperties): with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :vartype tags: dict[str, str] + :ivar kind: Indicates the type of database account. This can only be set at database account + creation. Known values are: "GlobalDocumentDB", "MongoDB", and "Parse". + :vartype kind: str or ~azure.mgmt.cosmosdb.models.DatabaseAccountKind :ivar identity: Identity for the resource. :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :ivar resource: - :vartype resource: ~azure.mgmt.cosmosdb.models.GraphResourceGetPropertiesResource - :ivar options: - :vartype options: ~azure.mgmt.cosmosdb.models.GraphResourceGetPropertiesOptions + :ivar consistency_policy: The consistency policy for the Cosmos DB account. + :vartype consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy + :ivar locations: An array that contains the georeplication locations enabled for the Cosmos DB + account. Required. + :vartype locations: list[~azure.mgmt.cosmosdb.models.Location] + :ivar database_account_offer_type: The offer type for the database. Required. Default value is + "Standard". + :vartype database_account_offer_type: str + :ivar ip_rules: List of IpRules. + :vartype ip_rules: list[~azure.mgmt.cosmosdb.models.IpAddressOrRange] + :ivar is_virtual_network_filter_enabled: Flag to indicate whether to enable/disable Virtual + Network ACL rules. + :vartype is_virtual_network_filter_enabled: bool + :ivar enable_automatic_failover: Enables automatic failover of the write region in the rare + event that the region is unavailable due to an outage. Automatic failover will result in a new + write region for the account and is chosen based on the failover priorities configured for the + account. + :vartype enable_automatic_failover: bool + :ivar capabilities: List of Cosmos DB capabilities for the account. + :vartype capabilities: list[~azure.mgmt.cosmosdb.models.Capability] + :ivar virtual_network_rules: List of Virtual Network ACL rules configured for the Cosmos DB + account. + :vartype virtual_network_rules: list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] + :ivar enable_multiple_write_locations: Enables the account to write in multiple locations. + :vartype enable_multiple_write_locations: bool + :ivar enable_cassandra_connector: Enables the cassandra connector on the Cosmos DB C* account. + :vartype enable_cassandra_connector: bool + :ivar connector_offer: The cassandra connector offer type for the Cosmos DB database C* + account. "Small" + :vartype connector_offer: str or ~azure.mgmt.cosmosdb.models.ConnectorOffer + :ivar disable_key_based_metadata_write_access: Disable write operations on metadata resources + (databases, containers, throughput) via account keys. + :vartype disable_key_based_metadata_write_access: bool + :ivar key_vault_key_uri: The URI of the key vault. + :vartype key_vault_key_uri: str + :ivar default_identity: The default identity for accessing key vault used in features like + customer managed keys. The default identity needs to be explicitly set by the users. It can be + "FirstPartyIdentity", "SystemAssignedIdentity" and more. + :vartype default_identity: str + :ivar public_network_access: Whether requests from Public Network are allowed. Known values + are: "Enabled", "Disabled", and "SecuredByPerimeter". + :vartype public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess + :ivar enable_free_tier: Flag to indicate whether Free Tier is enabled. + :vartype enable_free_tier: bool + :ivar api_properties: API specific properties. Currently, supported only for MongoDB API. + :vartype api_properties: ~azure.mgmt.cosmosdb.models.ApiProperties + :ivar enable_analytical_storage: Flag to indicate whether to enable storage analytics. + :vartype enable_analytical_storage: bool + :ivar analytical_storage_configuration: Analytical storage specific properties. + :vartype analytical_storage_configuration: + ~azure.mgmt.cosmosdb.models.AnalyticalStorageConfiguration + :ivar create_mode: Enum to indicate the mode of account creation. Known values are: "Default" + and "Restore". + :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :ivar backup_policy: The object representing the policy for taking backups on an account. + :vartype backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy + :ivar cors: The CORS policy for the Cosmos DB database account. + :vartype cors: list[~azure.mgmt.cosmosdb.models.CorsPolicy] + :ivar network_acl_bypass: Indicates what services are allowed to bypass firewall checks. Known + values are: "None" and "AzureServices". + :vartype network_acl_bypass: str or ~azure.mgmt.cosmosdb.models.NetworkAclBypass + :ivar network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network Acl + Bypass for the Cosmos DB account. + :vartype network_acl_bypass_resource_ids: list[str] + :ivar disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be + used exclusively for authentication. + :vartype disable_local_auth: bool + :ivar restore_parameters: Parameters to indicate the information about the restore. + :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.RestoreParameters + :ivar capacity: The object that represents all properties related to capacity enforcement on an + account. + :vartype capacity: ~azure.mgmt.cosmosdb.models.Capacity + :ivar keys_metadata: This property is ignored during the update/create operation, as the + metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB + account. + :vartype keys_metadata: ~azure.mgmt.cosmosdb.models.DatabaseAccountKeysMetadata + :ivar enable_partition_merge: Flag to indicate enabling/disabling of Partition Merge feature on + the account. + :vartype enable_partition_merge: bool + :ivar minimal_tls_version: Indicates the minimum allowed Tls version. The default value is Tls + 1.2. Cassandra and Mongo APIs only work with Tls 1.2. Known values are: "Tls", "Tls11", and + "Tls12". + :vartype minimal_tls_version: str or ~azure.mgmt.cosmosdb.models.MinimalTlsVersion + :ivar enable_burst_capacity: Flag to indicate enabling/disabling of Burst Capacity feature on + the account. + :vartype enable_burst_capacity: bool + :ivar customer_managed_key_status: Indicates the status of the Customer Managed Key feature on + the account. In case there are errors, the property provides troubleshooting guidance. + :vartype customer_managed_key_status: str + :ivar enable_per_region_per_partition_autoscale: Flag to indicate enabling/disabling of + PerRegionPerPartitionAutoscale feature on the account. + :vartype enable_per_region_per_partition_autoscale: bool """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "locations": {"required": True}, + "database_account_offer_type": {"required": True, "constant": True}, + "keys_metadata": {"readonly": True}, } _attribute_map = { @@ -6977,19 +2980,92 @@ class GraphResourceGetResults(ARMResourceProperties): "type": {"key": "type", "type": "str"}, "location": {"key": "location", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, + "kind": {"key": "kind", "type": "str"}, "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "resource": {"key": "properties.resource", "type": "GraphResourceGetPropertiesResource"}, - "options": {"key": "properties.options", "type": "GraphResourceGetPropertiesOptions"}, + "consistency_policy": {"key": "properties.consistencyPolicy", "type": "ConsistencyPolicy"}, + "locations": {"key": "properties.locations", "type": "[Location]"}, + "database_account_offer_type": {"key": "properties.databaseAccountOfferType", "type": "str"}, + "ip_rules": {"key": "properties.ipRules", "type": "[IpAddressOrRange]"}, + "is_virtual_network_filter_enabled": {"key": "properties.isVirtualNetworkFilterEnabled", "type": "bool"}, + "enable_automatic_failover": {"key": "properties.enableAutomaticFailover", "type": "bool"}, + "capabilities": {"key": "properties.capabilities", "type": "[Capability]"}, + "virtual_network_rules": {"key": "properties.virtualNetworkRules", "type": "[VirtualNetworkRule]"}, + "enable_multiple_write_locations": {"key": "properties.enableMultipleWriteLocations", "type": "bool"}, + "enable_cassandra_connector": {"key": "properties.enableCassandraConnector", "type": "bool"}, + "connector_offer": {"key": "properties.connectorOffer", "type": "str"}, + "disable_key_based_metadata_write_access": { + "key": "properties.disableKeyBasedMetadataWriteAccess", + "type": "bool", + }, + "key_vault_key_uri": {"key": "properties.keyVaultKeyUri", "type": "str"}, + "default_identity": {"key": "properties.defaultIdentity", "type": "str"}, + "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, + "enable_free_tier": {"key": "properties.enableFreeTier", "type": "bool"}, + "api_properties": {"key": "properties.apiProperties", "type": "ApiProperties"}, + "enable_analytical_storage": {"key": "properties.enableAnalyticalStorage", "type": "bool"}, + "analytical_storage_configuration": { + "key": "properties.analyticalStorageConfiguration", + "type": "AnalyticalStorageConfiguration", + }, + "create_mode": {"key": "properties.createMode", "type": "str"}, + "backup_policy": {"key": "properties.backupPolicy", "type": "BackupPolicy"}, + "cors": {"key": "properties.cors", "type": "[CorsPolicy]"}, + "network_acl_bypass": {"key": "properties.networkAclBypass", "type": "str"}, + "network_acl_bypass_resource_ids": {"key": "properties.networkAclBypassResourceIds", "type": "[str]"}, + "disable_local_auth": {"key": "properties.disableLocalAuth", "type": "bool"}, + "restore_parameters": {"key": "properties.restoreParameters", "type": "RestoreParameters"}, + "capacity": {"key": "properties.capacity", "type": "Capacity"}, + "keys_metadata": {"key": "properties.keysMetadata", "type": "DatabaseAccountKeysMetadata"}, + "enable_partition_merge": {"key": "properties.enablePartitionMerge", "type": "bool"}, + "minimal_tls_version": {"key": "properties.minimalTlsVersion", "type": "str"}, + "enable_burst_capacity": {"key": "properties.enableBurstCapacity", "type": "bool"}, + "customer_managed_key_status": {"key": "properties.customerManagedKeyStatus", "type": "str"}, + "enable_per_region_per_partition_autoscale": { + "key": "properties.enablePerRegionPerPartitionAutoscale", + "type": "bool", + }, } - def __init__( + database_account_offer_type = "Standard" + + def __init__( # pylint: disable=too-many-locals self, *, + locations: List["_models.Location"], location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + kind: Optional[Union[str, "_models.DatabaseAccountKind"]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, - resource: Optional["_models.GraphResourceGetPropertiesResource"] = None, - options: Optional["_models.GraphResourceGetPropertiesOptions"] = None, + consistency_policy: Optional["_models.ConsistencyPolicy"] = None, + ip_rules: Optional[List["_models.IpAddressOrRange"]] = None, + is_virtual_network_filter_enabled: Optional[bool] = None, + enable_automatic_failover: Optional[bool] = None, + capabilities: Optional[List["_models.Capability"]] = None, + virtual_network_rules: Optional[List["_models.VirtualNetworkRule"]] = None, + enable_multiple_write_locations: Optional[bool] = None, + enable_cassandra_connector: Optional[bool] = None, + connector_offer: Optional[Union[str, "_models.ConnectorOffer"]] = None, + disable_key_based_metadata_write_access: Optional[bool] = None, + key_vault_key_uri: Optional[str] = None, + default_identity: Optional[str] = None, + public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, + enable_free_tier: Optional[bool] = None, + api_properties: Optional["_models.ApiProperties"] = None, + enable_analytical_storage: Optional[bool] = None, + analytical_storage_configuration: Optional["_models.AnalyticalStorageConfiguration"] = None, + create_mode: Union[str, "_models.CreateMode"] = "Default", + backup_policy: Optional["_models.BackupPolicy"] = None, + cors: Optional[List["_models.CorsPolicy"]] = None, + network_acl_bypass: Optional[Union[str, "_models.NetworkAclBypass"]] = None, + network_acl_bypass_resource_ids: Optional[List[str]] = None, + disable_local_auth: Optional[bool] = None, + restore_parameters: Optional["_models.RestoreParameters"] = None, + capacity: Optional["_models.Capacity"] = None, + enable_partition_merge: Optional[bool] = None, + minimal_tls_version: Optional[Union[str, "_models.MinimalTlsVersion"]] = None, + enable_burst_capacity: Optional[bool] = None, + customer_managed_key_status: Optional[str] = None, + enable_per_region_per_partition_autoscale: Optional[bool] = None, **kwargs: Any ) -> None: """ @@ -7002,48 +3078,140 @@ def __init__( with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :paramtype tags: dict[str, str] + :keyword kind: Indicates the type of database account. This can only be set at database account + creation. Known values are: "GlobalDocumentDB", "MongoDB", and "Parse". + :paramtype kind: str or ~azure.mgmt.cosmosdb.models.DatabaseAccountKind :keyword identity: Identity for the resource. :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :keyword resource: - :paramtype resource: ~azure.mgmt.cosmosdb.models.GraphResourceGetPropertiesResource - :keyword options: - :paramtype options: ~azure.mgmt.cosmosdb.models.GraphResourceGetPropertiesOptions + :keyword consistency_policy: The consistency policy for the Cosmos DB account. + :paramtype consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy + :keyword locations: An array that contains the georeplication locations enabled for the Cosmos + DB account. Required. + :paramtype locations: list[~azure.mgmt.cosmosdb.models.Location] + :keyword ip_rules: List of IpRules. + :paramtype ip_rules: list[~azure.mgmt.cosmosdb.models.IpAddressOrRange] + :keyword is_virtual_network_filter_enabled: Flag to indicate whether to enable/disable Virtual + Network ACL rules. + :paramtype is_virtual_network_filter_enabled: bool + :keyword enable_automatic_failover: Enables automatic failover of the write region in the rare + event that the region is unavailable due to an outage. Automatic failover will result in a new + write region for the account and is chosen based on the failover priorities configured for the + account. + :paramtype enable_automatic_failover: bool + :keyword capabilities: List of Cosmos DB capabilities for the account. + :paramtype capabilities: list[~azure.mgmt.cosmosdb.models.Capability] + :keyword virtual_network_rules: List of Virtual Network ACL rules configured for the Cosmos DB + account. + :paramtype virtual_network_rules: list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] + :keyword enable_multiple_write_locations: Enables the account to write in multiple locations. + :paramtype enable_multiple_write_locations: bool + :keyword enable_cassandra_connector: Enables the cassandra connector on the Cosmos DB C* + account. + :paramtype enable_cassandra_connector: bool + :keyword connector_offer: The cassandra connector offer type for the Cosmos DB database C* + account. "Small" + :paramtype connector_offer: str or ~azure.mgmt.cosmosdb.models.ConnectorOffer + :keyword disable_key_based_metadata_write_access: Disable write operations on metadata + resources (databases, containers, throughput) via account keys. + :paramtype disable_key_based_metadata_write_access: bool + :keyword key_vault_key_uri: The URI of the key vault. + :paramtype key_vault_key_uri: str + :keyword default_identity: The default identity for accessing key vault used in features like + customer managed keys. The default identity needs to be explicitly set by the users. It can be + "FirstPartyIdentity", "SystemAssignedIdentity" and more. + :paramtype default_identity: str + :keyword public_network_access: Whether requests from Public Network are allowed. Known values + are: "Enabled", "Disabled", and "SecuredByPerimeter". + :paramtype public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess + :keyword enable_free_tier: Flag to indicate whether Free Tier is enabled. + :paramtype enable_free_tier: bool + :keyword api_properties: API specific properties. Currently, supported only for MongoDB API. + :paramtype api_properties: ~azure.mgmt.cosmosdb.models.ApiProperties + :keyword enable_analytical_storage: Flag to indicate whether to enable storage analytics. + :paramtype enable_analytical_storage: bool + :keyword analytical_storage_configuration: Analytical storage specific properties. + :paramtype analytical_storage_configuration: + ~azure.mgmt.cosmosdb.models.AnalyticalStorageConfiguration + :keyword create_mode: Enum to indicate the mode of account creation. Known values are: + "Default" and "Restore". + :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :keyword backup_policy: The object representing the policy for taking backups on an account. + :paramtype backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy + :keyword cors: The CORS policy for the Cosmos DB database account. + :paramtype cors: list[~azure.mgmt.cosmosdb.models.CorsPolicy] + :keyword network_acl_bypass: Indicates what services are allowed to bypass firewall checks. + Known values are: "None" and "AzureServices". + :paramtype network_acl_bypass: str or ~azure.mgmt.cosmosdb.models.NetworkAclBypass + :keyword network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network + Acl Bypass for the Cosmos DB account. + :paramtype network_acl_bypass_resource_ids: list[str] + :keyword disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be + used exclusively for authentication. + :paramtype disable_local_auth: bool + :keyword restore_parameters: Parameters to indicate the information about the restore. + :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.RestoreParameters + :keyword capacity: The object that represents all properties related to capacity enforcement on + an account. + :paramtype capacity: ~azure.mgmt.cosmosdb.models.Capacity + :keyword enable_partition_merge: Flag to indicate enabling/disabling of Partition Merge feature + on the account. + :paramtype enable_partition_merge: bool + :keyword minimal_tls_version: Indicates the minimum allowed Tls version. The default value is + Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. Known values are: "Tls", "Tls11", and + "Tls12". + :paramtype minimal_tls_version: str or ~azure.mgmt.cosmosdb.models.MinimalTlsVersion + :keyword enable_burst_capacity: Flag to indicate enabling/disabling of Burst Capacity feature + on the account. + :paramtype enable_burst_capacity: bool + :keyword customer_managed_key_status: Indicates the status of the Customer Managed Key feature + on the account. In case there are errors, the property provides troubleshooting guidance. + :paramtype customer_managed_key_status: str + :keyword enable_per_region_per_partition_autoscale: Flag to indicate enabling/disabling of + PerRegionPerPartitionAutoscale feature on the account. + :paramtype enable_per_region_per_partition_autoscale: bool """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.resource = resource - self.options = options - - -class GraphResourcesListResult(_serialization.Model): - """The List operation response, that contains the Graph resource and their properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of Graph resource and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.GraphResourceGetResults] - """ - - _validation = { - "value": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[GraphResourceGetResults]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None + super().__init__(location=location, tags=tags, **kwargs) + self.kind = kind + self.identity = identity + self.consistency_policy = consistency_policy + self.locations = locations + self.ip_rules = ip_rules + self.is_virtual_network_filter_enabled = is_virtual_network_filter_enabled + self.enable_automatic_failover = enable_automatic_failover + self.capabilities = capabilities + self.virtual_network_rules = virtual_network_rules + self.enable_multiple_write_locations = enable_multiple_write_locations + self.enable_cassandra_connector = enable_cassandra_connector + self.connector_offer = connector_offer + self.disable_key_based_metadata_write_access = disable_key_based_metadata_write_access + self.key_vault_key_uri = key_vault_key_uri + self.default_identity = default_identity + self.public_network_access = public_network_access + self.enable_free_tier = enable_free_tier + self.api_properties = api_properties + self.enable_analytical_storage = enable_analytical_storage + self.analytical_storage_configuration = analytical_storage_configuration + self.create_mode = create_mode + self.backup_policy = backup_policy + self.cors = cors + self.network_acl_bypass = network_acl_bypass + self.network_acl_bypass_resource_ids = network_acl_bypass_resource_ids + self.disable_local_auth = disable_local_auth + self.restore_parameters = restore_parameters + self.capacity = capacity + self.keys_metadata = None + self.enable_partition_merge = enable_partition_merge + self.minimal_tls_version = minimal_tls_version + self.enable_burst_capacity = enable_burst_capacity + self.customer_managed_key_status = customer_managed_key_status + self.enable_per_region_per_partition_autoscale = enable_per_region_per_partition_autoscale -class GremlinDatabaseCreateUpdateParameters(ARMResourceProperties): - """Parameters to create and update Cosmos DB Gremlin database. +class DatabaseAccountGetResults(ARMResourceProperties): + """An Azure Cosmos DB database account. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to server. - :ivar id: The unique resource identifier of the ARM resource. :vartype id: str :ivar name: The name of the ARM resource. @@ -7059,20 +3227,144 @@ class GremlinDatabaseCreateUpdateParameters(ARMResourceProperties): with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :vartype tags: dict[str, str] + :ivar kind: Indicates the type of database account. This can only be set at database account + creation. Known values are: "GlobalDocumentDB", "MongoDB", and "Parse". + :vartype kind: str or ~azure.mgmt.cosmosdb.models.DatabaseAccountKind :ivar identity: Identity for the resource. :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :ivar resource: The standard JSON format of a Gremlin database. Required. - :vartype resource: ~azure.mgmt.cosmosdb.models.GremlinDatabaseResource - :ivar options: A key-value pair of options to be applied for the request. This corresponds to - the headers sent with the request. - :vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.cosmosdb.models.SystemData + :ivar provisioning_state: The status of the Cosmos DB account at the time the operation was + called. The status can be one of following. 'Creating' – the Cosmos DB account is being + created. When an account is in Creating state, only properties that are specified as input for + the Create Cosmos DB account operation are returned. 'Succeeded' – the Cosmos DB account is + active for use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB + account is being deleted. 'Failed' – the Cosmos DB account failed creation. 'DeletionFailed' – + the Cosmos DB account deletion failed. + :vartype provisioning_state: str + :ivar document_endpoint: The connection endpoint for the Cosmos DB database account. + :vartype document_endpoint: str + :ivar database_account_offer_type: The offer type for the Cosmos DB database account. Default + value: Standard. Default value is "Standard". + :vartype database_account_offer_type: str + :ivar ip_rules: List of IpRules. + :vartype ip_rules: list[~azure.mgmt.cosmosdb.models.IpAddressOrRange] + :ivar is_virtual_network_filter_enabled: Flag to indicate whether to enable/disable Virtual + Network ACL rules. + :vartype is_virtual_network_filter_enabled: bool + :ivar enable_automatic_failover: Enables automatic failover of the write region in the rare + event that the region is unavailable due to an outage. Automatic failover will result in a new + write region for the account and is chosen based on the failover priorities configured for the + account. + :vartype enable_automatic_failover: bool + :ivar consistency_policy: The consistency policy for the Cosmos DB database account. + :vartype consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy + :ivar capabilities: List of Cosmos DB capabilities for the account. + :vartype capabilities: list[~azure.mgmt.cosmosdb.models.Capability] + :ivar write_locations: An array that contains the write location for the Cosmos DB account. + :vartype write_locations: list[~azure.mgmt.cosmosdb.models.Location] + :ivar read_locations: An array that contains of the read locations enabled for the Cosmos DB + account. + :vartype read_locations: list[~azure.mgmt.cosmosdb.models.Location] + :ivar locations: An array that contains all of the locations enabled for the Cosmos DB account. + :vartype locations: list[~azure.mgmt.cosmosdb.models.Location] + :ivar failover_policies: An array that contains the regions ordered by their failover + priorities. + :vartype failover_policies: list[~azure.mgmt.cosmosdb.models.FailoverPolicy] + :ivar virtual_network_rules: List of Virtual Network ACL rules configured for the Cosmos DB + account. + :vartype virtual_network_rules: list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] + :ivar private_endpoint_connections: List of Private Endpoint Connections configured for the + Cosmos DB account. + :vartype private_endpoint_connections: + list[~azure.mgmt.cosmosdb.models.PrivateEndpointConnection] + :ivar enable_multiple_write_locations: Enables the account to write in multiple locations. + :vartype enable_multiple_write_locations: bool + :ivar enable_cassandra_connector: Enables the cassandra connector on the Cosmos DB C* account. + :vartype enable_cassandra_connector: bool + :ivar connector_offer: The cassandra connector offer type for the Cosmos DB database C* + account. "Small" + :vartype connector_offer: str or ~azure.mgmt.cosmosdb.models.ConnectorOffer + :ivar disable_key_based_metadata_write_access: Disable write operations on metadata resources + (databases, containers, throughput) via account keys. + :vartype disable_key_based_metadata_write_access: bool + :ivar key_vault_key_uri: The URI of the key vault. + :vartype key_vault_key_uri: str + :ivar default_identity: The default identity for accessing key vault used in features like + customer managed keys. The default identity needs to be explicitly set by the users. It can be + "FirstPartyIdentity", "SystemAssignedIdentity" and more. + :vartype default_identity: str + :ivar public_network_access: Whether requests from Public Network are allowed. Known values + are: "Enabled", "Disabled", and "SecuredByPerimeter". + :vartype public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess + :ivar enable_free_tier: Flag to indicate whether Free Tier is enabled. + :vartype enable_free_tier: bool + :ivar api_properties: API specific properties. + :vartype api_properties: ~azure.mgmt.cosmosdb.models.ApiProperties + :ivar enable_analytical_storage: Flag to indicate whether to enable storage analytics. + :vartype enable_analytical_storage: bool + :ivar analytical_storage_configuration: Analytical storage specific properties. + :vartype analytical_storage_configuration: + ~azure.mgmt.cosmosdb.models.AnalyticalStorageConfiguration + :ivar instance_id: A unique identifier assigned to the database account. + :vartype instance_id: str + :ivar create_mode: Enum to indicate the mode of account creation. Known values are: "Default" + and "Restore". + :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :ivar restore_parameters: Parameters to indicate the information about the restore. + :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.RestoreParameters + :ivar backup_policy: The object representing the policy for taking backups on an account. + :vartype backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy + :ivar cors: The CORS policy for the Cosmos DB database account. + :vartype cors: list[~azure.mgmt.cosmosdb.models.CorsPolicy] + :ivar network_acl_bypass: Indicates what services are allowed to bypass firewall checks. Known + values are: "None" and "AzureServices". + :vartype network_acl_bypass: str or ~azure.mgmt.cosmosdb.models.NetworkAclBypass + :ivar network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network Acl + Bypass for the Cosmos DB account. + :vartype network_acl_bypass_resource_ids: list[str] + :ivar disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be + used exclusively for authentication. + :vartype disable_local_auth: bool + :ivar capacity: The object that represents all properties related to capacity enforcement on an + account. + :vartype capacity: ~azure.mgmt.cosmosdb.models.Capacity + :ivar keys_metadata: The object that represents the metadata for the Account Keys of the Cosmos + DB account. + :vartype keys_metadata: ~azure.mgmt.cosmosdb.models.DatabaseAccountKeysMetadata + :ivar enable_partition_merge: Flag to indicate enabling/disabling of Partition Merge feature on + the account. + :vartype enable_partition_merge: bool + :ivar minimal_tls_version: Indicates the minimum allowed Tls version. The default value is Tls + 1.2. Cassandra and Mongo APIs only work with Tls 1.2. Known values are: "Tls", "Tls11", and + "Tls12". + :vartype minimal_tls_version: str or ~azure.mgmt.cosmosdb.models.MinimalTlsVersion + :ivar enable_burst_capacity: Flag to indicate enabling/disabling of Burst Capacity feature on + the account. + :vartype enable_burst_capacity: bool + :ivar customer_managed_key_status: Indicates the status of the Customer Managed Key feature on + the account. In case there are errors, the property provides troubleshooting guidance. + :vartype customer_managed_key_status: str + :ivar enable_per_region_per_partition_autoscale: Flag to indicate enabling/disabling of + PerRegionPerPartitionAutoscale feature on the account. + :vartype enable_per_region_per_partition_autoscale: bool """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, - "resource": {"required": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "document_endpoint": {"readonly": True}, + "database_account_offer_type": {"readonly": True}, + "write_locations": {"readonly": True}, + "read_locations": {"readonly": True}, + "locations": {"readonly": True}, + "failover_policies": {"readonly": True}, + "private_endpoint_connections": {"readonly": True}, + "instance_id": {"readonly": True}, + "keys_metadata": {"readonly": True}, } _attribute_map = { @@ -7081,19 +3373,100 @@ class GremlinDatabaseCreateUpdateParameters(ARMResourceProperties): "type": {"key": "type", "type": "str"}, "location": {"key": "location", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, + "kind": {"key": "kind", "type": "str"}, "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "resource": {"key": "properties.resource", "type": "GremlinDatabaseResource"}, - "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "document_endpoint": {"key": "properties.documentEndpoint", "type": "str"}, + "database_account_offer_type": {"key": "properties.databaseAccountOfferType", "type": "str"}, + "ip_rules": {"key": "properties.ipRules", "type": "[IpAddressOrRange]"}, + "is_virtual_network_filter_enabled": {"key": "properties.isVirtualNetworkFilterEnabled", "type": "bool"}, + "enable_automatic_failover": {"key": "properties.enableAutomaticFailover", "type": "bool"}, + "consistency_policy": {"key": "properties.consistencyPolicy", "type": "ConsistencyPolicy"}, + "capabilities": {"key": "properties.capabilities", "type": "[Capability]"}, + "write_locations": {"key": "properties.writeLocations", "type": "[Location]"}, + "read_locations": {"key": "properties.readLocations", "type": "[Location]"}, + "locations": {"key": "properties.locations", "type": "[Location]"}, + "failover_policies": {"key": "properties.failoverPolicies", "type": "[FailoverPolicy]"}, + "virtual_network_rules": {"key": "properties.virtualNetworkRules", "type": "[VirtualNetworkRule]"}, + "private_endpoint_connections": { + "key": "properties.privateEndpointConnections", + "type": "[PrivateEndpointConnection]", + }, + "enable_multiple_write_locations": {"key": "properties.enableMultipleWriteLocations", "type": "bool"}, + "enable_cassandra_connector": {"key": "properties.enableCassandraConnector", "type": "bool"}, + "connector_offer": {"key": "properties.connectorOffer", "type": "str"}, + "disable_key_based_metadata_write_access": { + "key": "properties.disableKeyBasedMetadataWriteAccess", + "type": "bool", + }, + "key_vault_key_uri": {"key": "properties.keyVaultKeyUri", "type": "str"}, + "default_identity": {"key": "properties.defaultIdentity", "type": "str"}, + "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, + "enable_free_tier": {"key": "properties.enableFreeTier", "type": "bool"}, + "api_properties": {"key": "properties.apiProperties", "type": "ApiProperties"}, + "enable_analytical_storage": {"key": "properties.enableAnalyticalStorage", "type": "bool"}, + "analytical_storage_configuration": { + "key": "properties.analyticalStorageConfiguration", + "type": "AnalyticalStorageConfiguration", + }, + "instance_id": {"key": "properties.instanceId", "type": "str"}, + "create_mode": {"key": "properties.createMode", "type": "str"}, + "restore_parameters": {"key": "properties.restoreParameters", "type": "RestoreParameters"}, + "backup_policy": {"key": "properties.backupPolicy", "type": "BackupPolicy"}, + "cors": {"key": "properties.cors", "type": "[CorsPolicy]"}, + "network_acl_bypass": {"key": "properties.networkAclBypass", "type": "str"}, + "network_acl_bypass_resource_ids": {"key": "properties.networkAclBypassResourceIds", "type": "[str]"}, + "disable_local_auth": {"key": "properties.disableLocalAuth", "type": "bool"}, + "capacity": {"key": "properties.capacity", "type": "Capacity"}, + "keys_metadata": {"key": "properties.keysMetadata", "type": "DatabaseAccountKeysMetadata"}, + "enable_partition_merge": {"key": "properties.enablePartitionMerge", "type": "bool"}, + "minimal_tls_version": {"key": "properties.minimalTlsVersion", "type": "str"}, + "enable_burst_capacity": {"key": "properties.enableBurstCapacity", "type": "bool"}, + "customer_managed_key_status": {"key": "properties.customerManagedKeyStatus", "type": "str"}, + "enable_per_region_per_partition_autoscale": { + "key": "properties.enablePerRegionPerPartitionAutoscale", + "type": "bool", + }, } - def __init__( + def __init__( # pylint: disable=too-many-locals self, *, - resource: "_models.GremlinDatabaseResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + kind: Optional[Union[str, "_models.DatabaseAccountKind"]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, - options: Optional["_models.CreateUpdateOptions"] = None, + ip_rules: Optional[List["_models.IpAddressOrRange"]] = None, + is_virtual_network_filter_enabled: Optional[bool] = None, + enable_automatic_failover: Optional[bool] = None, + consistency_policy: Optional["_models.ConsistencyPolicy"] = None, + capabilities: Optional[List["_models.Capability"]] = None, + virtual_network_rules: Optional[List["_models.VirtualNetworkRule"]] = None, + enable_multiple_write_locations: Optional[bool] = None, + enable_cassandra_connector: Optional[bool] = None, + connector_offer: Optional[Union[str, "_models.ConnectorOffer"]] = None, + disable_key_based_metadata_write_access: Optional[bool] = None, + key_vault_key_uri: Optional[str] = None, + default_identity: Optional[str] = None, + public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, + enable_free_tier: Optional[bool] = None, + api_properties: Optional["_models.ApiProperties"] = None, + enable_analytical_storage: Optional[bool] = None, + analytical_storage_configuration: Optional["_models.AnalyticalStorageConfiguration"] = None, + create_mode: Union[str, "_models.CreateMode"] = "Default", + restore_parameters: Optional["_models.RestoreParameters"] = None, + backup_policy: Optional["_models.BackupPolicy"] = None, + cors: Optional[List["_models.CorsPolicy"]] = None, + network_acl_bypass: Optional[Union[str, "_models.NetworkAclBypass"]] = None, + network_acl_bypass_resource_ids: Optional[List[str]] = None, + disable_local_auth: Optional[bool] = None, + capacity: Optional["_models.Capacity"] = None, + enable_partition_merge: Optional[bool] = None, + minimal_tls_version: Optional[Union[str, "_models.MinimalTlsVersion"]] = None, + enable_burst_capacity: Optional[bool] = None, + customer_managed_key_status: Optional[str] = None, + enable_per_region_per_partition_autoscale: Optional[bool] = None, **kwargs: Any ) -> None: """ @@ -7106,285 +3479,328 @@ def __init__( with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :paramtype tags: dict[str, str] + :keyword kind: Indicates the type of database account. This can only be set at database account + creation. Known values are: "GlobalDocumentDB", "MongoDB", and "Parse". + :paramtype kind: str or ~azure.mgmt.cosmosdb.models.DatabaseAccountKind :keyword identity: Identity for the resource. :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :keyword resource: The standard JSON format of a Gremlin database. Required. - :paramtype resource: ~azure.mgmt.cosmosdb.models.GremlinDatabaseResource - :keyword options: A key-value pair of options to be applied for the request. This corresponds - to the headers sent with the request. - :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions + :keyword ip_rules: List of IpRules. + :paramtype ip_rules: list[~azure.mgmt.cosmosdb.models.IpAddressOrRange] + :keyword is_virtual_network_filter_enabled: Flag to indicate whether to enable/disable Virtual + Network ACL rules. + :paramtype is_virtual_network_filter_enabled: bool + :keyword enable_automatic_failover: Enables automatic failover of the write region in the rare + event that the region is unavailable due to an outage. Automatic failover will result in a new + write region for the account and is chosen based on the failover priorities configured for the + account. + :paramtype enable_automatic_failover: bool + :keyword consistency_policy: The consistency policy for the Cosmos DB database account. + :paramtype consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy + :keyword capabilities: List of Cosmos DB capabilities for the account. + :paramtype capabilities: list[~azure.mgmt.cosmosdb.models.Capability] + :keyword virtual_network_rules: List of Virtual Network ACL rules configured for the Cosmos DB + account. + :paramtype virtual_network_rules: list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] + :keyword enable_multiple_write_locations: Enables the account to write in multiple locations. + :paramtype enable_multiple_write_locations: bool + :keyword enable_cassandra_connector: Enables the cassandra connector on the Cosmos DB C* + account. + :paramtype enable_cassandra_connector: bool + :keyword connector_offer: The cassandra connector offer type for the Cosmos DB database C* + account. "Small" + :paramtype connector_offer: str or ~azure.mgmt.cosmosdb.models.ConnectorOffer + :keyword disable_key_based_metadata_write_access: Disable write operations on metadata + resources (databases, containers, throughput) via account keys. + :paramtype disable_key_based_metadata_write_access: bool + :keyword key_vault_key_uri: The URI of the key vault. + :paramtype key_vault_key_uri: str + :keyword default_identity: The default identity for accessing key vault used in features like + customer managed keys. The default identity needs to be explicitly set by the users. It can be + "FirstPartyIdentity", "SystemAssignedIdentity" and more. + :paramtype default_identity: str + :keyword public_network_access: Whether requests from Public Network are allowed. Known values + are: "Enabled", "Disabled", and "SecuredByPerimeter". + :paramtype public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess + :keyword enable_free_tier: Flag to indicate whether Free Tier is enabled. + :paramtype enable_free_tier: bool + :keyword api_properties: API specific properties. + :paramtype api_properties: ~azure.mgmt.cosmosdb.models.ApiProperties + :keyword enable_analytical_storage: Flag to indicate whether to enable storage analytics. + :paramtype enable_analytical_storage: bool + :keyword analytical_storage_configuration: Analytical storage specific properties. + :paramtype analytical_storage_configuration: + ~azure.mgmt.cosmosdb.models.AnalyticalStorageConfiguration + :keyword create_mode: Enum to indicate the mode of account creation. Known values are: + "Default" and "Restore". + :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :keyword restore_parameters: Parameters to indicate the information about the restore. + :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.RestoreParameters + :keyword backup_policy: The object representing the policy for taking backups on an account. + :paramtype backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy + :keyword cors: The CORS policy for the Cosmos DB database account. + :paramtype cors: list[~azure.mgmt.cosmosdb.models.CorsPolicy] + :keyword network_acl_bypass: Indicates what services are allowed to bypass firewall checks. + Known values are: "None" and "AzureServices". + :paramtype network_acl_bypass: str or ~azure.mgmt.cosmosdb.models.NetworkAclBypass + :keyword network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network + Acl Bypass for the Cosmos DB account. + :paramtype network_acl_bypass_resource_ids: list[str] + :keyword disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be + used exclusively for authentication. + :paramtype disable_local_auth: bool + :keyword capacity: The object that represents all properties related to capacity enforcement on + an account. + :paramtype capacity: ~azure.mgmt.cosmosdb.models.Capacity + :keyword enable_partition_merge: Flag to indicate enabling/disabling of Partition Merge feature + on the account. + :paramtype enable_partition_merge: bool + :keyword minimal_tls_version: Indicates the minimum allowed Tls version. The default value is + Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. Known values are: "Tls", "Tls11", and + "Tls12". + :paramtype minimal_tls_version: str or ~azure.mgmt.cosmosdb.models.MinimalTlsVersion + :keyword enable_burst_capacity: Flag to indicate enabling/disabling of Burst Capacity feature + on the account. + :paramtype enable_burst_capacity: bool + :keyword customer_managed_key_status: Indicates the status of the Customer Managed Key feature + on the account. In case there are errors, the property provides troubleshooting guidance. + :paramtype customer_managed_key_status: str + :keyword enable_per_region_per_partition_autoscale: Flag to indicate enabling/disabling of + PerRegionPerPartitionAutoscale feature on the account. + :paramtype enable_per_region_per_partition_autoscale: bool """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.resource = resource - self.options = options - - -class GremlinDatabaseGetPropertiesOptions(OptionsResource): - """GremlinDatabaseGetPropertiesOptions. - - :ivar throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the - ThroughputSetting resource when retrieving offer details. - :vartype throughput: int - :ivar autoscale_settings: Specifies the Autoscale settings. - :vartype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings - """ + super().__init__(location=location, tags=tags, **kwargs) + self.kind = kind + self.identity = identity + self.system_data = None + self.provisioning_state = None + self.document_endpoint = None + self.database_account_offer_type = None + self.ip_rules = ip_rules + self.is_virtual_network_filter_enabled = is_virtual_network_filter_enabled + self.enable_automatic_failover = enable_automatic_failover + self.consistency_policy = consistency_policy + self.capabilities = capabilities + self.write_locations = None + self.read_locations = None + self.locations = None + self.failover_policies = None + self.virtual_network_rules = virtual_network_rules + self.private_endpoint_connections = None + self.enable_multiple_write_locations = enable_multiple_write_locations + self.enable_cassandra_connector = enable_cassandra_connector + self.connector_offer = connector_offer + self.disable_key_based_metadata_write_access = disable_key_based_metadata_write_access + self.key_vault_key_uri = key_vault_key_uri + self.default_identity = default_identity + self.public_network_access = public_network_access + self.enable_free_tier = enable_free_tier + self.api_properties = api_properties + self.enable_analytical_storage = enable_analytical_storage + self.analytical_storage_configuration = analytical_storage_configuration + self.instance_id = None + self.create_mode = create_mode + self.restore_parameters = restore_parameters + self.backup_policy = backup_policy + self.cors = cors + self.network_acl_bypass = network_acl_bypass + self.network_acl_bypass_resource_ids = network_acl_bypass_resource_ids + self.disable_local_auth = disable_local_auth + self.capacity = capacity + self.keys_metadata = None + self.enable_partition_merge = enable_partition_merge + self.minimal_tls_version = minimal_tls_version + self.enable_burst_capacity = enable_burst_capacity + self.customer_managed_key_status = customer_managed_key_status + self.enable_per_region_per_partition_autoscale = enable_per_region_per_partition_autoscale -class GremlinDatabaseResource(_serialization.Model): - """Cosmos DB Gremlin database resource object. +class DatabaseAccountKeysMetadata(_serialization.Model): + """The metadata related to each access key for the given Cosmos DB database account. - All required parameters must be populated in order to send to server. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Name of the Cosmos DB Gremlin database. Required. - :vartype id: str - :ivar restore_parameters: Parameters to indicate the information about the restore. - :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" - and "Restore". - :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :ivar primary_master_key: The metadata related to the Primary Read-Write Key for the given + Cosmos DB database account. + :vartype primary_master_key: ~azure.mgmt.cosmosdb.models.AccountKeyMetadata + :ivar secondary_master_key: The metadata related to the Secondary Read-Write Key for the given + Cosmos DB database account. + :vartype secondary_master_key: ~azure.mgmt.cosmosdb.models.AccountKeyMetadata + :ivar primary_readonly_master_key: The metadata related to the Primary Read-Only Key for the + given Cosmos DB database account. + :vartype primary_readonly_master_key: ~azure.mgmt.cosmosdb.models.AccountKeyMetadata + :ivar secondary_readonly_master_key: The metadata related to the Secondary Read-Only Key for + the given Cosmos DB database account. + :vartype secondary_readonly_master_key: ~azure.mgmt.cosmosdb.models.AccountKeyMetadata """ _validation = { - "id": {"required": True}, + "primary_master_key": {"readonly": True}, + "secondary_master_key": {"readonly": True}, + "primary_readonly_master_key": {"readonly": True}, + "secondary_readonly_master_key": {"readonly": True}, } _attribute_map = { - "id": {"key": "id", "type": "str"}, - "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, - "create_mode": {"key": "createMode", "type": "str"}, + "primary_master_key": {"key": "primaryMasterKey", "type": "AccountKeyMetadata"}, + "secondary_master_key": {"key": "secondaryMasterKey", "type": "AccountKeyMetadata"}, + "primary_readonly_master_key": {"key": "primaryReadonlyMasterKey", "type": "AccountKeyMetadata"}, + "secondary_readonly_master_key": {"key": "secondaryReadonlyMasterKey", "type": "AccountKeyMetadata"}, } - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, - create_mode: Union[str, "_models.CreateMode"] = "Default", - **kwargs: Any - ) -> None: - """ - :keyword id: Name of the Cosmos DB Gremlin database. Required. - :paramtype id: str - :keyword restore_parameters: Parameters to indicate the information about the restore. - :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: - "Default" and "Restore". - :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.id = id - self.restore_parameters = restore_parameters - self.create_mode = create_mode - - -class GremlinDatabaseGetPropertiesResource(GremlinDatabaseResource, ExtendedResourceProperties): - """GremlinDatabaseGetPropertiesResource. + self.primary_master_key = None + self.secondary_master_key = None + self.primary_readonly_master_key = None + self.secondary_readonly_master_key = None - 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. +class DatabaseAccountListConnectionStringsResult(_serialization.Model): # pylint: disable=name-too-long + """The connection strings for the given database account. - :ivar rid: A system generated property. A unique identifier. - :vartype rid: str - :ivar ts: A system generated property that denotes the last updated timestamp of the resource. - :vartype ts: float - :ivar etag: A system generated property representing the resource etag required for optimistic - concurrency control. - :vartype etag: str - :ivar id: Name of the Cosmos DB Gremlin database. Required. - :vartype id: str - :ivar restore_parameters: Parameters to indicate the information about the restore. - :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" - and "Restore". - :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :ivar connection_strings: An array that contains the connection strings for the Cosmos DB + account. + :vartype connection_strings: list[~azure.mgmt.cosmosdb.models.DatabaseAccountConnectionString] """ - _validation = { - "rid": {"readonly": True}, - "ts": {"readonly": True}, - "etag": {"readonly": True}, - "id": {"required": True}, - } - _attribute_map = { - "rid": {"key": "_rid", "type": "str"}, - "ts": {"key": "_ts", "type": "float"}, - "etag": {"key": "_etag", "type": "str"}, - "id": {"key": "id", "type": "str"}, - "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, - "create_mode": {"key": "createMode", "type": "str"}, + "connection_strings": {"key": "connectionStrings", "type": "[DatabaseAccountConnectionString]"}, } def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, - create_mode: Union[str, "_models.CreateMode"] = "Default", - **kwargs: Any + self, *, connection_strings: Optional[List["_models.DatabaseAccountConnectionString"]] = None, **kwargs: Any ) -> None: """ - :keyword id: Name of the Cosmos DB Gremlin database. Required. - :paramtype id: str - :keyword restore_parameters: Parameters to indicate the information about the restore. - :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: - "Default" and "Restore". - :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode - """ - super().__init__(id=id, restore_parameters=restore_parameters, create_mode=create_mode, **kwargs) - self.rid = None - self.ts = None - self.etag = None - self.id = id - self.restore_parameters = restore_parameters - self.create_mode = create_mode - - -class GremlinDatabaseGetResults(ARMResourceProperties): - """An Azure Cosmos DB Gremlin database. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar location: The location of the resource group to which the resource belongs. - :vartype location: str - :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :ivar resource: - :vartype resource: ~azure.mgmt.cosmosdb.models.GremlinDatabaseGetPropertiesResource - :ivar options: - :vartype options: ~azure.mgmt.cosmosdb.models.GremlinDatabaseGetPropertiesOptions + :keyword connection_strings: An array that contains the connection strings for the Cosmos DB + account. + :paramtype connection_strings: + list[~azure.mgmt.cosmosdb.models.DatabaseAccountConnectionString] + """ + super().__init__(**kwargs) + self.connection_strings = connection_strings + + +class DatabaseAccountListReadOnlyKeysResult(_serialization.Model): + """The read-only access keys for the given database account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar primary_readonly_master_key: Base 64 encoded value of the primary read-only key. + :vartype primary_readonly_master_key: str + :ivar secondary_readonly_master_key: Base 64 encoded value of the secondary read-only key. + :vartype secondary_readonly_master_key: str """ _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, + "primary_readonly_master_key": {"readonly": True}, + "secondary_readonly_master_key": {"readonly": True}, } _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "resource": {"key": "properties.resource", "type": "GremlinDatabaseGetPropertiesResource"}, - "options": {"key": "properties.options", "type": "GremlinDatabaseGetPropertiesOptions"}, + "primary_readonly_master_key": {"key": "primaryReadonlyMasterKey", "type": "str"}, + "secondary_readonly_master_key": {"key": "secondaryReadonlyMasterKey", "type": "str"}, } - def __init__( - self, - *, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - resource: Optional["_models.GremlinDatabaseGetPropertiesResource"] = None, - options: Optional["_models.GremlinDatabaseGetPropertiesOptions"] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :keyword resource: - :paramtype resource: ~azure.mgmt.cosmosdb.models.GremlinDatabaseGetPropertiesResource - :keyword options: - :paramtype options: ~azure.mgmt.cosmosdb.models.GremlinDatabaseGetPropertiesOptions - """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.resource = resource - self.options = options + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.primary_readonly_master_key = None + self.secondary_readonly_master_key = None -class GremlinDatabaseListResult(_serialization.Model): - """The List operation response, that contains the Gremlin databases and their properties. +class DatabaseAccountListKeysResult(DatabaseAccountListReadOnlyKeysResult): + """The access keys for the given database account. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of Gremlin databases and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.GremlinDatabaseGetResults] + :ivar primary_readonly_master_key: Base 64 encoded value of the primary read-only key. + :vartype primary_readonly_master_key: str + :ivar secondary_readonly_master_key: Base 64 encoded value of the secondary read-only key. + :vartype secondary_readonly_master_key: str + :ivar primary_master_key: Base 64 encoded value of the primary read-write key. + :vartype primary_master_key: str + :ivar secondary_master_key: Base 64 encoded value of the secondary read-write key. + :vartype secondary_master_key: str """ _validation = { - "value": {"readonly": True}, + "primary_readonly_master_key": {"readonly": True}, + "secondary_readonly_master_key": {"readonly": True}, + "primary_master_key": {"readonly": True}, + "secondary_master_key": {"readonly": True}, } _attribute_map = { - "value": {"key": "value", "type": "[GremlinDatabaseGetResults]"}, + "primary_readonly_master_key": {"key": "primaryReadonlyMasterKey", "type": "str"}, + "secondary_readonly_master_key": {"key": "secondaryReadonlyMasterKey", "type": "str"}, + "primary_master_key": {"key": "primaryMasterKey", "type": "str"}, + "secondary_master_key": {"key": "secondaryMasterKey", "type": "str"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None + self.primary_master_key = None + self.secondary_master_key = None -class GremlinDatabaseRestoreResource(_serialization.Model): - """Specific Gremlin Databases to restore. +class DatabaseAccountRegenerateKeyParameters(_serialization.Model): + """Parameters to regenerate the keys within the database account. - :ivar database_name: The name of the gremlin database available for restore. - :vartype database_name: str - :ivar graph_names: The names of the graphs available for restore. - :vartype graph_names: list[str] + All required parameters must be populated in order to send to server. + + :ivar key_kind: The access key to regenerate. Required. Known values are: "primary", + "secondary", "primaryReadonly", and "secondaryReadonly". + :vartype key_kind: str or ~azure.mgmt.cosmosdb.models.KeyKind """ + _validation = { + "key_kind": {"required": True}, + } + _attribute_map = { - "database_name": {"key": "databaseName", "type": "str"}, - "graph_names": {"key": "graphNames", "type": "[str]"}, + "key_kind": {"key": "keyKind", "type": "str"}, } - def __init__( - self, *, database_name: Optional[str] = None, graph_names: Optional[List[str]] = None, **kwargs: Any - ) -> None: + def __init__(self, *, key_kind: Union[str, "_models.KeyKind"], **kwargs: Any) -> None: """ - :keyword database_name: The name of the gremlin database available for restore. - :paramtype database_name: str - :keyword graph_names: The names of the graphs available for restore. - :paramtype graph_names: list[str] + :keyword key_kind: The access key to regenerate. Required. Known values are: "primary", + "secondary", "primaryReadonly", and "secondaryReadonly". + :paramtype key_kind: str or ~azure.mgmt.cosmosdb.models.KeyKind """ super().__init__(**kwargs) - self.database_name = database_name - self.graph_names = graph_names + self.key_kind = key_kind -class GremlinGraphCreateUpdateParameters(ARMResourceProperties): - """Parameters to create and update Cosmos DB Gremlin graph. +class DatabaseAccountsListResult(_serialization.Model): + """The List operation response, that contains the database accounts and their properties. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to server. + :ivar value: List of database account and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.DatabaseAccountGetResults] + """ + + _validation = { + "value": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[DatabaseAccountGetResults]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None + + +class DatabaseAccountUpdateParameters(_serialization.Model): + """Parameters for patching Azure Cosmos DB database account properties. + + Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar location: The location of the resource group to which the resource belongs. - :vartype location: str :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value @@ -7392,46 +3808,182 @@ class GremlinGraphCreateUpdateParameters(ARMResourceProperties): with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :vartype tags: dict[str, str] + :ivar location: The location of the resource group to which the resource belongs. + :vartype location: str :ivar identity: Identity for the resource. :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :ivar resource: The standard JSON format of a Gremlin graph. Required. - :vartype resource: ~azure.mgmt.cosmosdb.models.GremlinGraphResource - :ivar options: A key-value pair of options to be applied for the request. This corresponds to - the headers sent with the request. - :vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions + :ivar consistency_policy: The consistency policy for the Cosmos DB account. + :vartype consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy + :ivar locations: An array that contains the georeplication locations enabled for the Cosmos DB + account. + :vartype locations: list[~azure.mgmt.cosmosdb.models.Location] + :ivar ip_rules: List of IpRules. + :vartype ip_rules: list[~azure.mgmt.cosmosdb.models.IpAddressOrRange] + :ivar is_virtual_network_filter_enabled: Flag to indicate whether to enable/disable Virtual + Network ACL rules. + :vartype is_virtual_network_filter_enabled: bool + :ivar enable_automatic_failover: Enables automatic failover of the write region in the rare + event that the region is unavailable due to an outage. Automatic failover will result in a new + write region for the account and is chosen based on the failover priorities configured for the + account. + :vartype enable_automatic_failover: bool + :ivar capabilities: List of Cosmos DB capabilities for the account. + :vartype capabilities: list[~azure.mgmt.cosmosdb.models.Capability] + :ivar virtual_network_rules: List of Virtual Network ACL rules configured for the Cosmos DB + account. + :vartype virtual_network_rules: list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] + :ivar enable_multiple_write_locations: Enables the account to write in multiple locations. + :vartype enable_multiple_write_locations: bool + :ivar enable_cassandra_connector: Enables the cassandra connector on the Cosmos DB C* account. + :vartype enable_cassandra_connector: bool + :ivar connector_offer: The cassandra connector offer type for the Cosmos DB database C* + account. "Small" + :vartype connector_offer: str or ~azure.mgmt.cosmosdb.models.ConnectorOffer + :ivar disable_key_based_metadata_write_access: Disable write operations on metadata resources + (databases, containers, throughput) via account keys. + :vartype disable_key_based_metadata_write_access: bool + :ivar key_vault_key_uri: The URI of the key vault. + :vartype key_vault_key_uri: str + :ivar default_identity: The default identity for accessing key vault used in features like + customer managed keys. The default identity needs to be explicitly set by the users. It can be + "FirstPartyIdentity", "SystemAssignedIdentity" and more. + :vartype default_identity: str + :ivar public_network_access: Whether requests from Public Network are allowed. Known values + are: "Enabled", "Disabled", and "SecuredByPerimeter". + :vartype public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess + :ivar enable_free_tier: Flag to indicate whether Free Tier is enabled. + :vartype enable_free_tier: bool + :ivar api_properties: API specific properties. Currently, supported only for MongoDB API. + :vartype api_properties: ~azure.mgmt.cosmosdb.models.ApiProperties + :ivar enable_analytical_storage: Flag to indicate whether to enable storage analytics. + :vartype enable_analytical_storage: bool + :ivar analytical_storage_configuration: Analytical storage specific properties. + :vartype analytical_storage_configuration: + ~azure.mgmt.cosmosdb.models.AnalyticalStorageConfiguration + :ivar backup_policy: The object representing the policy for taking backups on an account. + :vartype backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy + :ivar cors: The CORS policy for the Cosmos DB database account. + :vartype cors: list[~azure.mgmt.cosmosdb.models.CorsPolicy] + :ivar network_acl_bypass: Indicates what services are allowed to bypass firewall checks. Known + values are: "None" and "AzureServices". + :vartype network_acl_bypass: str or ~azure.mgmt.cosmosdb.models.NetworkAclBypass + :ivar network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network Acl + Bypass for the Cosmos DB account. + :vartype network_acl_bypass_resource_ids: list[str] + :ivar disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be + used exclusively for authentication. + :vartype disable_local_auth: bool + :ivar capacity: The object that represents all properties related to capacity enforcement on an + account. + :vartype capacity: ~azure.mgmt.cosmosdb.models.Capacity + :ivar keys_metadata: This property is ignored during the update operation, as the metadata is + read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. + :vartype keys_metadata: ~azure.mgmt.cosmosdb.models.DatabaseAccountKeysMetadata + :ivar enable_partition_merge: Flag to indicate enabling/disabling of Partition Merge feature on + the account. + :vartype enable_partition_merge: bool + :ivar minimal_tls_version: Indicates the minimum allowed Tls version. The default value is Tls + 1.2. Cassandra and Mongo APIs only work with Tls 1.2. Known values are: "Tls", "Tls11", and + "Tls12". + :vartype minimal_tls_version: str or ~azure.mgmt.cosmosdb.models.MinimalTlsVersion + :ivar enable_burst_capacity: Flag to indicate enabling/disabling of Burst Capacity feature on + the account. + :vartype enable_burst_capacity: bool + :ivar customer_managed_key_status: Indicates the status of the Customer Managed Key feature on + the account. In case there are errors, the property provides troubleshooting guidance. + :vartype customer_managed_key_status: str + :ivar enable_per_region_per_partition_autoscale: Flag to indicate enabling/disabling of + PerRegionPerPartitionAutoscale feature on the account. + :vartype enable_per_region_per_partition_autoscale: bool """ _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "resource": {"required": True}, + "keys_metadata": {"readonly": True}, } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, + + _attribute_map = { "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "resource": {"key": "properties.resource", "type": "GremlinGraphResource"}, - "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, + "consistency_policy": {"key": "properties.consistencyPolicy", "type": "ConsistencyPolicy"}, + "locations": {"key": "properties.locations", "type": "[Location]"}, + "ip_rules": {"key": "properties.ipRules", "type": "[IpAddressOrRange]"}, + "is_virtual_network_filter_enabled": {"key": "properties.isVirtualNetworkFilterEnabled", "type": "bool"}, + "enable_automatic_failover": {"key": "properties.enableAutomaticFailover", "type": "bool"}, + "capabilities": {"key": "properties.capabilities", "type": "[Capability]"}, + "virtual_network_rules": {"key": "properties.virtualNetworkRules", "type": "[VirtualNetworkRule]"}, + "enable_multiple_write_locations": {"key": "properties.enableMultipleWriteLocations", "type": "bool"}, + "enable_cassandra_connector": {"key": "properties.enableCassandraConnector", "type": "bool"}, + "connector_offer": {"key": "properties.connectorOffer", "type": "str"}, + "disable_key_based_metadata_write_access": { + "key": "properties.disableKeyBasedMetadataWriteAccess", + "type": "bool", + }, + "key_vault_key_uri": {"key": "properties.keyVaultKeyUri", "type": "str"}, + "default_identity": {"key": "properties.defaultIdentity", "type": "str"}, + "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, + "enable_free_tier": {"key": "properties.enableFreeTier", "type": "bool"}, + "api_properties": {"key": "properties.apiProperties", "type": "ApiProperties"}, + "enable_analytical_storage": {"key": "properties.enableAnalyticalStorage", "type": "bool"}, + "analytical_storage_configuration": { + "key": "properties.analyticalStorageConfiguration", + "type": "AnalyticalStorageConfiguration", + }, + "backup_policy": {"key": "properties.backupPolicy", "type": "BackupPolicy"}, + "cors": {"key": "properties.cors", "type": "[CorsPolicy]"}, + "network_acl_bypass": {"key": "properties.networkAclBypass", "type": "str"}, + "network_acl_bypass_resource_ids": {"key": "properties.networkAclBypassResourceIds", "type": "[str]"}, + "disable_local_auth": {"key": "properties.disableLocalAuth", "type": "bool"}, + "capacity": {"key": "properties.capacity", "type": "Capacity"}, + "keys_metadata": {"key": "properties.keysMetadata", "type": "DatabaseAccountKeysMetadata"}, + "enable_partition_merge": {"key": "properties.enablePartitionMerge", "type": "bool"}, + "minimal_tls_version": {"key": "properties.minimalTlsVersion", "type": "str"}, + "enable_burst_capacity": {"key": "properties.enableBurstCapacity", "type": "bool"}, + "customer_managed_key_status": {"key": "properties.customerManagedKeyStatus", "type": "str"}, + "enable_per_region_per_partition_autoscale": { + "key": "properties.enablePerRegionPerPartitionAutoscale", + "type": "bool", + }, } - def __init__( + def __init__( # pylint: disable=too-many-locals self, *, - resource: "_models.GremlinGraphResource", - location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + location: Optional[str] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, - options: Optional["_models.CreateUpdateOptions"] = None, + consistency_policy: Optional["_models.ConsistencyPolicy"] = None, + locations: Optional[List["_models.Location"]] = None, + ip_rules: Optional[List["_models.IpAddressOrRange"]] = None, + is_virtual_network_filter_enabled: Optional[bool] = None, + enable_automatic_failover: Optional[bool] = None, + capabilities: Optional[List["_models.Capability"]] = None, + virtual_network_rules: Optional[List["_models.VirtualNetworkRule"]] = None, + enable_multiple_write_locations: Optional[bool] = None, + enable_cassandra_connector: Optional[bool] = None, + connector_offer: Optional[Union[str, "_models.ConnectorOffer"]] = None, + disable_key_based_metadata_write_access: Optional[bool] = None, + key_vault_key_uri: Optional[str] = None, + default_identity: Optional[str] = None, + public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, + enable_free_tier: Optional[bool] = None, + api_properties: Optional["_models.ApiProperties"] = None, + enable_analytical_storage: Optional[bool] = None, + analytical_storage_configuration: Optional["_models.AnalyticalStorageConfiguration"] = None, + backup_policy: Optional["_models.BackupPolicy"] = None, + cors: Optional[List["_models.CorsPolicy"]] = None, + network_acl_bypass: Optional[Union[str, "_models.NetworkAclBypass"]] = None, + network_acl_bypass_resource_ids: Optional[List[str]] = None, + disable_local_auth: Optional[bool] = None, + capacity: Optional["_models.Capacity"] = None, + enable_partition_merge: Optional[bool] = None, + minimal_tls_version: Optional[Union[str, "_models.MinimalTlsVersion"]] = None, + enable_burst_capacity: Optional[bool] = None, + customer_managed_key_status: Optional[str] = None, + enable_per_region_per_partition_autoscale: Optional[bool] = None, **kwargs: Any ) -> None: """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value @@ -7439,1363 +3991,1864 @@ def __init__( with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :paramtype tags: dict[str, str] + :keyword location: The location of the resource group to which the resource belongs. + :paramtype location: str :keyword identity: Identity for the resource. :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :keyword resource: The standard JSON format of a Gremlin graph. Required. - :paramtype resource: ~azure.mgmt.cosmosdb.models.GremlinGraphResource - :keyword options: A key-value pair of options to be applied for the request. This corresponds - to the headers sent with the request. - :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions + :keyword consistency_policy: The consistency policy for the Cosmos DB account. + :paramtype consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy + :keyword locations: An array that contains the georeplication locations enabled for the Cosmos + DB account. + :paramtype locations: list[~azure.mgmt.cosmosdb.models.Location] + :keyword ip_rules: List of IpRules. + :paramtype ip_rules: list[~azure.mgmt.cosmosdb.models.IpAddressOrRange] + :keyword is_virtual_network_filter_enabled: Flag to indicate whether to enable/disable Virtual + Network ACL rules. + :paramtype is_virtual_network_filter_enabled: bool + :keyword enable_automatic_failover: Enables automatic failover of the write region in the rare + event that the region is unavailable due to an outage. Automatic failover will result in a new + write region for the account and is chosen based on the failover priorities configured for the + account. + :paramtype enable_automatic_failover: bool + :keyword capabilities: List of Cosmos DB capabilities for the account. + :paramtype capabilities: list[~azure.mgmt.cosmosdb.models.Capability] + :keyword virtual_network_rules: List of Virtual Network ACL rules configured for the Cosmos DB + account. + :paramtype virtual_network_rules: list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] + :keyword enable_multiple_write_locations: Enables the account to write in multiple locations. + :paramtype enable_multiple_write_locations: bool + :keyword enable_cassandra_connector: Enables the cassandra connector on the Cosmos DB C* + account. + :paramtype enable_cassandra_connector: bool + :keyword connector_offer: The cassandra connector offer type for the Cosmos DB database C* + account. "Small" + :paramtype connector_offer: str or ~azure.mgmt.cosmosdb.models.ConnectorOffer + :keyword disable_key_based_metadata_write_access: Disable write operations on metadata + resources (databases, containers, throughput) via account keys. + :paramtype disable_key_based_metadata_write_access: bool + :keyword key_vault_key_uri: The URI of the key vault. + :paramtype key_vault_key_uri: str + :keyword default_identity: The default identity for accessing key vault used in features like + customer managed keys. The default identity needs to be explicitly set by the users. It can be + "FirstPartyIdentity", "SystemAssignedIdentity" and more. + :paramtype default_identity: str + :keyword public_network_access: Whether requests from Public Network are allowed. Known values + are: "Enabled", "Disabled", and "SecuredByPerimeter". + :paramtype public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess + :keyword enable_free_tier: Flag to indicate whether Free Tier is enabled. + :paramtype enable_free_tier: bool + :keyword api_properties: API specific properties. Currently, supported only for MongoDB API. + :paramtype api_properties: ~azure.mgmt.cosmosdb.models.ApiProperties + :keyword enable_analytical_storage: Flag to indicate whether to enable storage analytics. + :paramtype enable_analytical_storage: bool + :keyword analytical_storage_configuration: Analytical storage specific properties. + :paramtype analytical_storage_configuration: + ~azure.mgmt.cosmosdb.models.AnalyticalStorageConfiguration + :keyword backup_policy: The object representing the policy for taking backups on an account. + :paramtype backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy + :keyword cors: The CORS policy for the Cosmos DB database account. + :paramtype cors: list[~azure.mgmt.cosmosdb.models.CorsPolicy] + :keyword network_acl_bypass: Indicates what services are allowed to bypass firewall checks. + Known values are: "None" and "AzureServices". + :paramtype network_acl_bypass: str or ~azure.mgmt.cosmosdb.models.NetworkAclBypass + :keyword network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network + Acl Bypass for the Cosmos DB account. + :paramtype network_acl_bypass_resource_ids: list[str] + :keyword disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be + used exclusively for authentication. + :paramtype disable_local_auth: bool + :keyword capacity: The object that represents all properties related to capacity enforcement on + an account. + :paramtype capacity: ~azure.mgmt.cosmosdb.models.Capacity + :keyword enable_partition_merge: Flag to indicate enabling/disabling of Partition Merge feature + on the account. + :paramtype enable_partition_merge: bool + :keyword minimal_tls_version: Indicates the minimum allowed Tls version. The default value is + Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. Known values are: "Tls", "Tls11", and + "Tls12". + :paramtype minimal_tls_version: str or ~azure.mgmt.cosmosdb.models.MinimalTlsVersion + :keyword enable_burst_capacity: Flag to indicate enabling/disabling of Burst Capacity feature + on the account. + :paramtype enable_burst_capacity: bool + :keyword customer_managed_key_status: Indicates the status of the Customer Managed Key feature + on the account. In case there are errors, the property provides troubleshooting guidance. + :paramtype customer_managed_key_status: str + :keyword enable_per_region_per_partition_autoscale: Flag to indicate enabling/disabling of + PerRegionPerPartitionAutoscale feature on the account. + :paramtype enable_per_region_per_partition_autoscale: bool """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.resource = resource - self.options = options - - -class GremlinGraphGetPropertiesOptions(OptionsResource): - """GremlinGraphGetPropertiesOptions. - - :ivar throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the - ThroughputSetting resource when retrieving offer details. - :vartype throughput: int - :ivar autoscale_settings: Specifies the Autoscale settings. - :vartype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings - """ - - -class GremlinGraphResource(_serialization.Model): - """Cosmos DB Gremlin graph resource object. - - All required parameters must be populated in order to send to server. + super().__init__(**kwargs) + self.tags = tags + self.location = location + self.identity = identity + self.consistency_policy = consistency_policy + self.locations = locations + self.ip_rules = ip_rules + self.is_virtual_network_filter_enabled = is_virtual_network_filter_enabled + self.enable_automatic_failover = enable_automatic_failover + self.capabilities = capabilities + self.virtual_network_rules = virtual_network_rules + self.enable_multiple_write_locations = enable_multiple_write_locations + self.enable_cassandra_connector = enable_cassandra_connector + self.connector_offer = connector_offer + self.disable_key_based_metadata_write_access = disable_key_based_metadata_write_access + self.key_vault_key_uri = key_vault_key_uri + self.default_identity = default_identity + self.public_network_access = public_network_access + self.enable_free_tier = enable_free_tier + self.api_properties = api_properties + self.enable_analytical_storage = enable_analytical_storage + self.analytical_storage_configuration = analytical_storage_configuration + self.backup_policy = backup_policy + self.cors = cors + self.network_acl_bypass = network_acl_bypass + self.network_acl_bypass_resource_ids = network_acl_bypass_resource_ids + self.disable_local_auth = disable_local_auth + self.capacity = capacity + self.keys_metadata = None + self.enable_partition_merge = enable_partition_merge + self.minimal_tls_version = minimal_tls_version + self.enable_burst_capacity = enable_burst_capacity + self.customer_managed_key_status = customer_managed_key_status + self.enable_per_region_per_partition_autoscale = enable_per_region_per_partition_autoscale - :ivar id: Name of the Cosmos DB Gremlin graph. Required. - :vartype id: str - :ivar indexing_policy: The configuration of the indexing policy. By default, the indexing is - automatic for all document paths within the graph. - :vartype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy - :ivar partition_key: The configuration of the partition key to be used for partitioning data - into multiple partitions. - :vartype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey - :ivar default_ttl: Default time to live. - :vartype default_ttl: int - :ivar unique_key_policy: The unique key policy configuration for specifying uniqueness - constraints on documents in the collection in the Azure Cosmos DB service. - :vartype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy - :ivar conflict_resolution_policy: The conflict resolution policy for the graph. - :vartype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy - :ivar analytical_storage_ttl: Analytical TTL. - :vartype analytical_storage_ttl: int - :ivar restore_parameters: Parameters to indicate the information about the restore. - :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" - and "Restore". - :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode - """ - _validation = { - "id": {"required": True}, - } +class DatabaseRestoreResource(_serialization.Model): + """Specific Databases to restore. - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "indexing_policy": {"key": "indexingPolicy", "type": "IndexingPolicy"}, - "partition_key": {"key": "partitionKey", "type": "ContainerPartitionKey"}, - "default_ttl": {"key": "defaultTtl", "type": "int"}, - "unique_key_policy": {"key": "uniqueKeyPolicy", "type": "UniqueKeyPolicy"}, - "conflict_resolution_policy": {"key": "conflictResolutionPolicy", "type": "ConflictResolutionPolicy"}, - "analytical_storage_ttl": {"key": "analyticalStorageTtl", "type": "int"}, - "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, - "create_mode": {"key": "createMode", "type": "str"}, + :ivar database_name: The name of the database available for restore. + :vartype database_name: str + :ivar collection_names: The names of the collections available for restore. + :vartype collection_names: list[str] + """ + + _attribute_map = { + "database_name": {"key": "databaseName", "type": "str"}, + "collection_names": {"key": "collectionNames", "type": "[str]"}, } def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - indexing_policy: Optional["_models.IndexingPolicy"] = None, - partition_key: Optional["_models.ContainerPartitionKey"] = None, - default_ttl: Optional[int] = None, - unique_key_policy: Optional["_models.UniqueKeyPolicy"] = None, - conflict_resolution_policy: Optional["_models.ConflictResolutionPolicy"] = None, - analytical_storage_ttl: Optional[int] = None, - restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, - create_mode: Union[str, "_models.CreateMode"] = "Default", - **kwargs: Any + self, *, database_name: Optional[str] = None, collection_names: Optional[List[str]] = None, **kwargs: Any ) -> None: """ - :keyword id: Name of the Cosmos DB Gremlin graph. Required. - :paramtype id: str - :keyword indexing_policy: The configuration of the indexing policy. By default, the indexing is - automatic for all document paths within the graph. - :paramtype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy - :keyword partition_key: The configuration of the partition key to be used for partitioning data - into multiple partitions. - :paramtype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey - :keyword default_ttl: Default time to live. - :paramtype default_ttl: int - :keyword unique_key_policy: The unique key policy configuration for specifying uniqueness - constraints on documents in the collection in the Azure Cosmos DB service. - :paramtype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy - :keyword conflict_resolution_policy: The conflict resolution policy for the graph. - :paramtype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy - :keyword analytical_storage_ttl: Analytical TTL. - :paramtype analytical_storage_ttl: int - :keyword restore_parameters: Parameters to indicate the information about the restore. - :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: - "Default" and "Restore". - :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :keyword database_name: The name of the database available for restore. + :paramtype database_name: str + :keyword collection_names: The names of the collections available for restore. + :paramtype collection_names: list[str] """ super().__init__(**kwargs) - self.id = id - self.indexing_policy = indexing_policy - self.partition_key = partition_key - self.default_ttl = default_ttl - self.unique_key_policy = unique_key_policy - self.conflict_resolution_policy = conflict_resolution_policy - self.analytical_storage_ttl = analytical_storage_ttl - self.restore_parameters = restore_parameters - self.create_mode = create_mode + self.database_name = database_name + self.collection_names = collection_names -class GremlinGraphGetPropertiesResource(GremlinGraphResource, ExtendedResourceProperties): - """GremlinGraphGetPropertiesResource. +class DataCenterResource(ARMProxyResource): + """A managed Cassandra data center. 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 rid: A system generated property. A unique identifier. - :vartype rid: str - :ivar ts: A system generated property that denotes the last updated timestamp of the resource. - :vartype ts: float - :ivar etag: A system generated property representing the resource etag required for optimistic - concurrency control. - :vartype etag: str - :ivar id: Name of the Cosmos DB Gremlin graph. Required. + :ivar id: The unique resource identifier of the database account. :vartype id: str - :ivar indexing_policy: The configuration of the indexing policy. By default, the indexing is - automatic for all document paths within the graph. - :vartype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy - :ivar partition_key: The configuration of the partition key to be used for partitioning data - into multiple partitions. - :vartype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey - :ivar default_ttl: Default time to live. - :vartype default_ttl: int - :ivar unique_key_policy: The unique key policy configuration for specifying uniqueness - constraints on documents in the collection in the Azure Cosmos DB service. - :vartype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy - :ivar conflict_resolution_policy: The conflict resolution policy for the graph. - :vartype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy - :ivar analytical_storage_ttl: Analytical TTL. - :vartype analytical_storage_ttl: int - :ivar restore_parameters: Parameters to indicate the information about the restore. - :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" - and "Restore". - :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :ivar name: The name of the database account. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :ivar properties: Properties of a managed Cassandra data center. + :vartype properties: ~azure.mgmt.cosmosdb.models.DataCenterResourceProperties """ _validation = { - "rid": {"readonly": True}, - "ts": {"readonly": True}, - "etag": {"readonly": True}, - "id": {"required": True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { - "rid": {"key": "_rid", "type": "str"}, - "ts": {"key": "_ts", "type": "float"}, - "etag": {"key": "_etag", "type": "str"}, "id": {"key": "id", "type": "str"}, - "indexing_policy": {"key": "indexingPolicy", "type": "IndexingPolicy"}, - "partition_key": {"key": "partitionKey", "type": "ContainerPartitionKey"}, - "default_ttl": {"key": "defaultTtl", "type": "int"}, - "unique_key_policy": {"key": "uniqueKeyPolicy", "type": "UniqueKeyPolicy"}, - "conflict_resolution_policy": {"key": "conflictResolutionPolicy", "type": "ConflictResolutionPolicy"}, - "analytical_storage_ttl": {"key": "analyticalStorageTtl", "type": "int"}, - "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, - "create_mode": {"key": "createMode", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "properties": {"key": "properties", "type": "DataCenterResourceProperties"}, } - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - indexing_policy: Optional["_models.IndexingPolicy"] = None, - partition_key: Optional["_models.ContainerPartitionKey"] = None, - default_ttl: Optional[int] = None, - unique_key_policy: Optional["_models.UniqueKeyPolicy"] = None, - conflict_resolution_policy: Optional["_models.ConflictResolutionPolicy"] = None, - analytical_storage_ttl: Optional[int] = None, - restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, - create_mode: Union[str, "_models.CreateMode"] = "Default", - **kwargs: Any - ) -> None: + def __init__(self, *, properties: Optional["_models.DataCenterResourceProperties"] = None, **kwargs: Any) -> None: """ - :keyword id: Name of the Cosmos DB Gremlin graph. Required. - :paramtype id: str - :keyword indexing_policy: The configuration of the indexing policy. By default, the indexing is - automatic for all document paths within the graph. - :paramtype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy - :keyword partition_key: The configuration of the partition key to be used for partitioning data - into multiple partitions. - :paramtype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey - :keyword default_ttl: Default time to live. - :paramtype default_ttl: int - :keyword unique_key_policy: The unique key policy configuration for specifying uniqueness - constraints on documents in the collection in the Azure Cosmos DB service. - :paramtype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy - :keyword conflict_resolution_policy: The conflict resolution policy for the graph. - :paramtype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy - :keyword analytical_storage_ttl: Analytical TTL. - :paramtype analytical_storage_ttl: int - :keyword restore_parameters: Parameters to indicate the information about the restore. - :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: - "Default" and "Restore". - :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :keyword properties: Properties of a managed Cassandra data center. + :paramtype properties: ~azure.mgmt.cosmosdb.models.DataCenterResourceProperties """ - super().__init__( - id=id, - indexing_policy=indexing_policy, - partition_key=partition_key, - default_ttl=default_ttl, - unique_key_policy=unique_key_policy, - conflict_resolution_policy=conflict_resolution_policy, - analytical_storage_ttl=analytical_storage_ttl, - restore_parameters=restore_parameters, - create_mode=create_mode, - **kwargs - ) - self.rid = None - self.ts = None - self.etag = None - self.id = id - self.indexing_policy = indexing_policy - self.partition_key = partition_key - self.default_ttl = default_ttl - self.unique_key_policy = unique_key_policy - self.conflict_resolution_policy = conflict_resolution_policy - self.analytical_storage_ttl = analytical_storage_ttl - self.restore_parameters = restore_parameters - self.create_mode = create_mode + super().__init__(**kwargs) + self.properties = properties -class GremlinGraphGetResults(ARMResourceProperties): - """An Azure Cosmos DB Gremlin graph. +class DataCenterResourceProperties(_serialization.Model): + """Properties of a managed Cassandra data center. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar location: The location of the resource group to which the resource belongs. - :vartype location: str - :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :ivar resource: - :vartype resource: ~azure.mgmt.cosmosdb.models.GremlinGraphGetPropertiesResource - :ivar options: - :vartype options: ~azure.mgmt.cosmosdb.models.GremlinGraphGetPropertiesOptions + :ivar provisioning_state: The status of the resource at the time the operation was called. + Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and "Canceled". + :vartype provisioning_state: str or + ~azure.mgmt.cosmosdb.models.ManagedCassandraProvisioningState + :ivar data_center_location: The region this data center should be created in. + :vartype data_center_location: str + :ivar delegated_subnet_id: Resource id of a subnet the nodes in this data center should have + their network interfaces connected to. The subnet must be in the same region specified in + 'dataCenterLocation' and must be able to route to the subnet specified in the cluster's + 'delegatedManagementSubnetId' property. This resource id will be of the form '/subscriptions/\\ + :code:``/resourceGroups/\\ :code:``/providers/Microsoft.Network/virtualNetworks/\\ :code:``/subnets/\\ + :code:``'. + :vartype delegated_subnet_id: str + :ivar node_count: The number of nodes the data center should have. This is the desired number. + After it is set, it may take some time for the data center to be scaled to match. To monitor + the number of nodes and their status, use the fetchNodeStatus method on the cluster. + :vartype node_count: int + :ivar seed_nodes: IP addresses for seed nodes in this data center. This is for reference. + Generally you will want to use the seedNodes property on the cluster, which aggregates the seed + nodes from all data centers in the cluster. + :vartype seed_nodes: list[~azure.mgmt.cosmosdb.models.SeedNode] + :ivar base64_encoded_cassandra_yaml_fragment: A fragment of a cassandra.yaml configuration file + to be included in the cassandra.yaml for all nodes in this data center. The fragment should be + Base64 encoded, and only a subset of keys are allowed. + :vartype base64_encoded_cassandra_yaml_fragment: str + :ivar managed_disk_customer_key_uri: Key uri to use for encryption of managed disks. Ensure the + system assigned identity of the cluster has been assigned appropriate permissions(key + get/wrap/unwrap permissions) on the key. + :vartype managed_disk_customer_key_uri: str + :ivar backup_storage_customer_key_uri: Indicates the Key Uri of the customer key to use for + encryption of the backup storage account. + :vartype backup_storage_customer_key_uri: str + :ivar sku: Virtual Machine SKU used for data centers. Default value is Standard_DS14_v2. + :vartype sku: str + :ivar disk_sku: Disk SKU used for data centers. Default value is P30. + :vartype disk_sku: str + :ivar disk_capacity: Number of disks attached to each node. Default is 4. + :vartype disk_capacity: int + :ivar availability_zone: If the data center has Availability Zone support, apply it to the + Virtual Machine ScaleSet that host the cassandra data center virtual machines. + :vartype availability_zone: bool + :ivar authentication_method_ldap_properties: Ldap authentication method properties. This + feature is in preview. + :vartype authentication_method_ldap_properties: + ~azure.mgmt.cosmosdb.models.AuthenticationMethodLdapProperties + :ivar deallocated: Whether the data center has been deallocated. + :vartype deallocated: bool + :ivar provision_error: Error related to resource provisioning. + :vartype provision_error: ~azure.mgmt.cosmosdb.models.CassandraError + :ivar private_endpoint_ip_address: Ip of the VPN Endpoint for this data center. + :vartype private_endpoint_ip_address: str """ _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, + "seed_nodes": {"readonly": True}, } _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "resource": {"key": "properties.resource", "type": "GremlinGraphGetPropertiesResource"}, - "options": {"key": "properties.options", "type": "GremlinGraphGetPropertiesOptions"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "data_center_location": {"key": "dataCenterLocation", "type": "str"}, + "delegated_subnet_id": {"key": "delegatedSubnetId", "type": "str"}, + "node_count": {"key": "nodeCount", "type": "int"}, + "seed_nodes": {"key": "seedNodes", "type": "[SeedNode]"}, + "base64_encoded_cassandra_yaml_fragment": {"key": "base64EncodedCassandraYamlFragment", "type": "str"}, + "managed_disk_customer_key_uri": {"key": "managedDiskCustomerKeyUri", "type": "str"}, + "backup_storage_customer_key_uri": {"key": "backupStorageCustomerKeyUri", "type": "str"}, + "sku": {"key": "sku", "type": "str"}, + "disk_sku": {"key": "diskSku", "type": "str"}, + "disk_capacity": {"key": "diskCapacity", "type": "int"}, + "availability_zone": {"key": "availabilityZone", "type": "bool"}, + "authentication_method_ldap_properties": { + "key": "authenticationMethodLdapProperties", + "type": "AuthenticationMethodLdapProperties", + }, + "deallocated": {"key": "deallocated", "type": "bool"}, + "provision_error": {"key": "provisionError", "type": "CassandraError"}, + "private_endpoint_ip_address": {"key": "privateEndpointIpAddress", "type": "str"}, } def __init__( self, *, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - resource: Optional["_models.GremlinGraphGetPropertiesResource"] = None, - options: Optional["_models.GremlinGraphGetPropertiesOptions"] = None, + provisioning_state: Optional[Union[str, "_models.ManagedCassandraProvisioningState"]] = None, + data_center_location: Optional[str] = None, + delegated_subnet_id: Optional[str] = None, + node_count: Optional[int] = None, + base64_encoded_cassandra_yaml_fragment: Optional[str] = None, + managed_disk_customer_key_uri: Optional[str] = None, + backup_storage_customer_key_uri: Optional[str] = None, + sku: Optional[str] = None, + disk_sku: Optional[str] = None, + disk_capacity: Optional[int] = None, + availability_zone: Optional[bool] = None, + authentication_method_ldap_properties: Optional["_models.AuthenticationMethodLdapProperties"] = None, + deallocated: Optional[bool] = None, + provision_error: Optional["_models.CassandraError"] = None, + private_endpoint_ip_address: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :keyword resource: - :paramtype resource: ~azure.mgmt.cosmosdb.models.GremlinGraphGetPropertiesResource - :keyword options: - :paramtype options: ~azure.mgmt.cosmosdb.models.GremlinGraphGetPropertiesOptions + :keyword provisioning_state: The status of the resource at the time the operation was called. + Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and "Canceled". + :paramtype provisioning_state: str or + ~azure.mgmt.cosmosdb.models.ManagedCassandraProvisioningState + :keyword data_center_location: The region this data center should be created in. + :paramtype data_center_location: str + :keyword delegated_subnet_id: Resource id of a subnet the nodes in this data center should have + their network interfaces connected to. The subnet must be in the same region specified in + 'dataCenterLocation' and must be able to route to the subnet specified in the cluster's + 'delegatedManagementSubnetId' property. This resource id will be of the form '/subscriptions/\\ + :code:``/resourceGroups/\\ :code:``/providers/Microsoft.Network/virtualNetworks/\\ :code:``/subnets/\\ + :code:``'. + :paramtype delegated_subnet_id: str + :keyword node_count: The number of nodes the data center should have. This is the desired + number. After it is set, it may take some time for the data center to be scaled to match. To + monitor the number of nodes and their status, use the fetchNodeStatus method on the cluster. + :paramtype node_count: int + :keyword base64_encoded_cassandra_yaml_fragment: A fragment of a cassandra.yaml configuration + file to be included in the cassandra.yaml for all nodes in this data center. The fragment + should be Base64 encoded, and only a subset of keys are allowed. + :paramtype base64_encoded_cassandra_yaml_fragment: str + :keyword managed_disk_customer_key_uri: Key uri to use for encryption of managed disks. Ensure + the system assigned identity of the cluster has been assigned appropriate permissions(key + get/wrap/unwrap permissions) on the key. + :paramtype managed_disk_customer_key_uri: str + :keyword backup_storage_customer_key_uri: Indicates the Key Uri of the customer key to use for + encryption of the backup storage account. + :paramtype backup_storage_customer_key_uri: str + :keyword sku: Virtual Machine SKU used for data centers. Default value is Standard_DS14_v2. + :paramtype sku: str + :keyword disk_sku: Disk SKU used for data centers. Default value is P30. + :paramtype disk_sku: str + :keyword disk_capacity: Number of disks attached to each node. Default is 4. + :paramtype disk_capacity: int + :keyword availability_zone: If the data center has Availability Zone support, apply it to the + Virtual Machine ScaleSet that host the cassandra data center virtual machines. + :paramtype availability_zone: bool + :keyword authentication_method_ldap_properties: Ldap authentication method properties. This + feature is in preview. + :paramtype authentication_method_ldap_properties: + ~azure.mgmt.cosmosdb.models.AuthenticationMethodLdapProperties + :keyword deallocated: Whether the data center has been deallocated. + :paramtype deallocated: bool + :keyword provision_error: Error related to resource provisioning. + :paramtype provision_error: ~azure.mgmt.cosmosdb.models.CassandraError + :keyword private_endpoint_ip_address: Ip of the VPN Endpoint for this data center. + :paramtype private_endpoint_ip_address: str """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.resource = resource - self.options = options + super().__init__(**kwargs) + self.provisioning_state = provisioning_state + self.data_center_location = data_center_location + self.delegated_subnet_id = delegated_subnet_id + self.node_count = node_count + self.seed_nodes = None + self.base64_encoded_cassandra_yaml_fragment = base64_encoded_cassandra_yaml_fragment + self.managed_disk_customer_key_uri = managed_disk_customer_key_uri + self.backup_storage_customer_key_uri = backup_storage_customer_key_uri + self.sku = sku + self.disk_sku = disk_sku + self.disk_capacity = disk_capacity + self.availability_zone = availability_zone + self.authentication_method_ldap_properties = authentication_method_ldap_properties + self.deallocated = deallocated + self.provision_error = provision_error + self.private_endpoint_ip_address = private_endpoint_ip_address -class GremlinGraphListResult(_serialization.Model): - """The List operation response, that contains the graphs and their properties. +class RegionalServiceResource(_serialization.Model): + """Resource for a regional service location. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of graphs and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.GremlinGraphGetResults] + :ivar name: The regional service name. + :vartype name: str + :ivar location: The location name. + :vartype location: str + :ivar status: Describes the status of a service. Known values are: "Creating", "Running", + "Updating", "Deleting", "Error", and "Stopped". + :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus """ _validation = { - "value": {"readonly": True}, + "name": {"readonly": True}, + "location": {"readonly": True}, + "status": {"readonly": True}, } _attribute_map = { - "value": {"key": "value", "type": "[GremlinGraphGetResults]"}, + "name": {"key": "name", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "status": {"key": "status", "type": "str"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None + self.name = None + self.location = None + self.status = None -class IncludedPath(_serialization.Model): - """The paths that are included in indexing. +class DataTransferRegionalServiceResource(RegionalServiceResource): + """Resource for a regional service location. - :ivar path: The path for which the indexing behavior applies to. Index paths typically start - with root and end with wildcard (/path/*). - :vartype path: str - :ivar indexes: List of indexes for this path. - :vartype indexes: list[~azure.mgmt.cosmosdb.models.Indexes] + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The regional service name. + :vartype name: str + :ivar location: The location name. + :vartype location: str + :ivar status: Describes the status of a service. Known values are: "Creating", "Running", + "Updating", "Deleting", "Error", and "Stopped". + :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus + """ + + +class DataTransferServiceResource(_serialization.Model): + """Describes the service response property. + + :ivar properties: Properties for DataTransferServiceResource. + :vartype properties: ~azure.mgmt.cosmosdb.models.DataTransferServiceResourceProperties """ _attribute_map = { - "path": {"key": "path", "type": "str"}, - "indexes": {"key": "indexes", "type": "[Indexes]"}, + "properties": {"key": "properties", "type": "DataTransferServiceResourceProperties"}, } def __init__( - self, *, path: Optional[str] = None, indexes: Optional[List["_models.Indexes"]] = None, **kwargs: Any + self, *, properties: Optional["_models.DataTransferServiceResourceProperties"] = None, **kwargs: Any ) -> None: """ - :keyword path: The path for which the indexing behavior applies to. Index paths typically start - with root and end with wildcard (/path/*). - :paramtype path: str - :keyword indexes: List of indexes for this path. - :paramtype indexes: list[~azure.mgmt.cosmosdb.models.Indexes] + :keyword properties: Properties for DataTransferServiceResource. + :paramtype properties: ~azure.mgmt.cosmosdb.models.DataTransferServiceResourceProperties """ super().__init__(**kwargs) - self.path = path - self.indexes = indexes + self.properties = properties + + +class ServiceResourceCreateUpdateProperties(_serialization.Model): + """Properties in ServiceResourceCreateUpdateParameters. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + DataTransferServiceResourceCreateUpdateProperties, + GraphAPIComputeServiceResourceCreateUpdateProperties, + MaterializedViewsBuilderServiceResourceCreateUpdateProperties, + SqlDedicatedGatewayServiceResourceCreateUpdateProperties + + All required parameters must be populated in order to send to server. + + :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", + "Cosmos.D8s", and "Cosmos.D16s". + :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :ivar instance_count: Instance count for the service. + :vartype instance_count: int + :ivar service_type: ServiceType for the service. Required. Known values are: + "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". + :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType + """ + + _validation = { + "instance_count": {"minimum": 0}, + "service_type": {"required": True}, + } + + _attribute_map = { + "instance_size": {"key": "instanceSize", "type": "str"}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "service_type": {"key": "serviceType", "type": "str"}, + } + + _subtype_map = { + "service_type": { + "DataTransfer": "DataTransferServiceResourceCreateUpdateProperties", + "GraphAPICompute": "GraphAPIComputeServiceResourceCreateUpdateProperties", + "MaterializedViewsBuilder": "MaterializedViewsBuilderServiceResourceCreateUpdateProperties", + "SqlDedicatedGateway": "SqlDedicatedGatewayServiceResourceCreateUpdateProperties", + } + } + + def __init__( + self, + *, + instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, + instance_count: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", + "Cosmos.D8s", and "Cosmos.D16s". + :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :keyword instance_count: Instance count for the service. + :paramtype instance_count: int + """ + super().__init__(**kwargs) + self.instance_size = instance_size + self.instance_count = instance_count + self.service_type: Optional[str] = None -class Indexes(_serialization.Model): - """The indexes for the path. +class DataTransferServiceResourceCreateUpdateProperties( + ServiceResourceCreateUpdateProperties +): # pylint: disable=name-too-long + """Properties for Create or Update request for DataTransferServiceResource. - :ivar data_type: The datatype for which the indexing behavior is applied to. Known values are: - "String", "Number", "Point", "Polygon", "LineString", and "MultiPolygon". - :vartype data_type: str or ~azure.mgmt.cosmosdb.models.DataType - :ivar precision: The precision of the index. -1 is maximum precision. - :vartype precision: int - :ivar kind: Indicates the type of index. Known values are: "Hash", "Range", and "Spatial". - :vartype kind: str or ~azure.mgmt.cosmosdb.models.IndexKind + All required parameters must be populated in order to send to server. + + :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", + "Cosmos.D8s", and "Cosmos.D16s". + :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :ivar instance_count: Instance count for the service. + :vartype instance_count: int + :ivar service_type: ServiceType for the service. Required. Known values are: + "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". + :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType """ + _validation = { + "instance_count": {"minimum": 0}, + "service_type": {"required": True}, + } + _attribute_map = { - "data_type": {"key": "dataType", "type": "str"}, - "precision": {"key": "precision", "type": "int"}, - "kind": {"key": "kind", "type": "str"}, + "instance_size": {"key": "instanceSize", "type": "str"}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "service_type": {"key": "serviceType", "type": "str"}, } def __init__( self, *, - data_type: Union[str, "_models.DataType"] = "String", - precision: Optional[int] = None, - kind: Union[str, "_models.IndexKind"] = "Hash", + instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, + instance_count: Optional[int] = None, **kwargs: Any ) -> None: """ - :keyword data_type: The datatype for which the indexing behavior is applied to. Known values - are: "String", "Number", "Point", "Polygon", "LineString", and "MultiPolygon". - :paramtype data_type: str or ~azure.mgmt.cosmosdb.models.DataType - :keyword precision: The precision of the index. -1 is maximum precision. - :paramtype precision: int - :keyword kind: Indicates the type of index. Known values are: "Hash", "Range", and "Spatial". - :paramtype kind: str or ~azure.mgmt.cosmosdb.models.IndexKind + :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", + "Cosmos.D8s", and "Cosmos.D16s". + :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :keyword instance_count: Instance count for the service. + :paramtype instance_count: int """ - super().__init__(**kwargs) - self.data_type = data_type - self.precision = precision - self.kind = kind + super().__init__(instance_size=instance_size, instance_count=instance_count, **kwargs) + self.service_type: str = "DataTransfer" -class IndexingPolicy(_serialization.Model): - """Cosmos DB indexing policy. +class ServiceResourceProperties(_serialization.Model): + """Services response resource. - :ivar automatic: Indicates if the indexing policy is automatic. - :vartype automatic: bool - :ivar indexing_mode: Indicates the indexing mode. Known values are: "consistent", "lazy", and - "none". - :vartype indexing_mode: str or ~azure.mgmt.cosmosdb.models.IndexingMode - :ivar included_paths: List of paths to include in the indexing. - :vartype included_paths: list[~azure.mgmt.cosmosdb.models.IncludedPath] - :ivar excluded_paths: List of paths to exclude from indexing. - :vartype excluded_paths: list[~azure.mgmt.cosmosdb.models.ExcludedPath] - :ivar composite_indexes: List of composite path list. - :vartype composite_indexes: list[list[~azure.mgmt.cosmosdb.models.CompositePath]] - :ivar spatial_indexes: List of spatial specifics. - :vartype spatial_indexes: list[~azure.mgmt.cosmosdb.models.SpatialSpec] - :ivar vector_indexes: List of paths to include in the vector indexing. - :vartype vector_indexes: list[~azure.mgmt.cosmosdb.models.VectorIndex] + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + DataTransferServiceResourceProperties, GraphAPIComputeServiceResourceProperties, + MaterializedViewsBuilderServiceResourceProperties, SqlDedicatedGatewayServiceResourceProperties + + 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 additional_properties: Unmatched properties from the message are deserialized to this + collection. + :vartype additional_properties: dict[str, any] + :ivar creation_time: Time of the last state change (ISO-8601 format). + :vartype creation_time: ~datetime.datetime + :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", + "Cosmos.D8s", and "Cosmos.D16s". + :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :ivar instance_count: Instance count for the service. + :vartype instance_count: int + :ivar service_type: ServiceType for the service. Required. Known values are: + "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". + :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType + :ivar status: Describes the status of a service. Known values are: "Creating", "Running", + "Updating", "Deleting", "Error", and "Stopped". + :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus """ + _validation = { + "creation_time": {"readonly": True}, + "instance_count": {"minimum": 0}, + "service_type": {"required": True}, + "status": {"readonly": True}, + } + _attribute_map = { - "automatic": {"key": "automatic", "type": "bool"}, - "indexing_mode": {"key": "indexingMode", "type": "str"}, - "included_paths": {"key": "includedPaths", "type": "[IncludedPath]"}, - "excluded_paths": {"key": "excludedPaths", "type": "[ExcludedPath]"}, - "composite_indexes": {"key": "compositeIndexes", "type": "[[CompositePath]]"}, - "spatial_indexes": {"key": "spatialIndexes", "type": "[SpatialSpec]"}, - "vector_indexes": {"key": "vectorIndexes", "type": "[VectorIndex]"}, + "additional_properties": {"key": "", "type": "{object}"}, + "creation_time": {"key": "creationTime", "type": "iso-8601"}, + "instance_size": {"key": "instanceSize", "type": "str"}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "service_type": {"key": "serviceType", "type": "str"}, + "status": {"key": "status", "type": "str"}, + } + + _subtype_map = { + "service_type": { + "DataTransfer": "DataTransferServiceResourceProperties", + "GraphAPICompute": "GraphAPIComputeServiceResourceProperties", + "MaterializedViewsBuilder": "MaterializedViewsBuilderServiceResourceProperties", + "SqlDedicatedGateway": "SqlDedicatedGatewayServiceResourceProperties", + } } def __init__( self, *, - automatic: Optional[bool] = None, - indexing_mode: Union[str, "_models.IndexingMode"] = "consistent", - included_paths: Optional[List["_models.IncludedPath"]] = None, - excluded_paths: Optional[List["_models.ExcludedPath"]] = None, - composite_indexes: Optional[List[List["_models.CompositePath"]]] = None, - spatial_indexes: Optional[List["_models.SpatialSpec"]] = None, - vector_indexes: Optional[List["_models.VectorIndex"]] = None, + additional_properties: Optional[Dict[str, Any]] = None, + instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, + instance_count: Optional[int] = None, **kwargs: Any ) -> None: """ - :keyword automatic: Indicates if the indexing policy is automatic. - :paramtype automatic: bool - :keyword indexing_mode: Indicates the indexing mode. Known values are: "consistent", "lazy", - and "none". - :paramtype indexing_mode: str or ~azure.mgmt.cosmosdb.models.IndexingMode - :keyword included_paths: List of paths to include in the indexing. - :paramtype included_paths: list[~azure.mgmt.cosmosdb.models.IncludedPath] - :keyword excluded_paths: List of paths to exclude from indexing. - :paramtype excluded_paths: list[~azure.mgmt.cosmosdb.models.ExcludedPath] - :keyword composite_indexes: List of composite path list. - :paramtype composite_indexes: list[list[~azure.mgmt.cosmosdb.models.CompositePath]] - :keyword spatial_indexes: List of spatial specifics. - :paramtype spatial_indexes: list[~azure.mgmt.cosmosdb.models.SpatialSpec] - :keyword vector_indexes: List of paths to include in the vector indexing. - :paramtype vector_indexes: list[~azure.mgmt.cosmosdb.models.VectorIndex] + :keyword additional_properties: Unmatched properties from the message are deserialized to this + collection. + :paramtype additional_properties: dict[str, any] + :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", + "Cosmos.D8s", and "Cosmos.D16s". + :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :keyword instance_count: Instance count for the service. + :paramtype instance_count: int """ super().__init__(**kwargs) - self.automatic = automatic - self.indexing_mode = indexing_mode - self.included_paths = included_paths - self.excluded_paths = excluded_paths - self.composite_indexes = composite_indexes - self.spatial_indexes = spatial_indexes - self.vector_indexes = vector_indexes + self.additional_properties = additional_properties + self.creation_time = None + self.instance_size = instance_size + self.instance_count = instance_count + self.service_type: Optional[str] = None + self.status = None -class IpAddressOrRange(_serialization.Model): - """IpAddressOrRange object. +class DataTransferServiceResourceProperties(ServiceResourceProperties): + """Properties for DataTransferServiceResource. - :ivar ip_address_or_range: A single IPv4 address or a single IPv4 address range in CIDR format. - Provided IPs must be well-formatted and cannot be contained in one of the following ranges: - 10.0.0.0/8, 100.64.0.0/10, 172.16.0.0/12, 192.168.0.0/16, since these are not enforceable by - the IP address filter. Example of valid inputs: “23.40.210.245” or “23.40.210.0/8”. - :vartype ip_address_or_range: str + 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 additional_properties: Unmatched properties from the message are deserialized to this + collection. + :vartype additional_properties: dict[str, any] + :ivar creation_time: Time of the last state change (ISO-8601 format). + :vartype creation_time: ~datetime.datetime + :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", + "Cosmos.D8s", and "Cosmos.D16s". + :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :ivar instance_count: Instance count for the service. + :vartype instance_count: int + :ivar service_type: ServiceType for the service. Required. Known values are: + "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". + :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType + :ivar status: Describes the status of a service. Known values are: "Creating", "Running", + "Updating", "Deleting", "Error", and "Stopped". + :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus + :ivar locations: An array that contains all of the locations for the service. + :vartype locations: list[~azure.mgmt.cosmosdb.models.DataTransferRegionalServiceResource] """ + _validation = { + "creation_time": {"readonly": True}, + "instance_count": {"minimum": 0}, + "service_type": {"required": True}, + "status": {"readonly": True}, + "locations": {"readonly": True}, + } + _attribute_map = { - "ip_address_or_range": {"key": "ipAddressOrRange", "type": "str"}, + "additional_properties": {"key": "", "type": "{object}"}, + "creation_time": {"key": "creationTime", "type": "iso-8601"}, + "instance_size": {"key": "instanceSize", "type": "str"}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "service_type": {"key": "serviceType", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "locations": {"key": "locations", "type": "[DataTransferRegionalServiceResource]"}, } - def __init__(self, *, ip_address_or_range: Optional[str] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + additional_properties: Optional[Dict[str, Any]] = None, + instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, + instance_count: Optional[int] = None, + **kwargs: Any + ) -> None: """ - :keyword ip_address_or_range: A single IPv4 address or a single IPv4 address range in CIDR - format. Provided IPs must be well-formatted and cannot be contained in one of the following - ranges: 10.0.0.0/8, 100.64.0.0/10, 172.16.0.0/12, 192.168.0.0/16, since these are not - enforceable by the IP address filter. Example of valid inputs: “23.40.210.245” or - “23.40.210.0/8”. - :paramtype ip_address_or_range: str + :keyword additional_properties: Unmatched properties from the message are deserialized to this + collection. + :paramtype additional_properties: dict[str, any] + :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", + "Cosmos.D8s", and "Cosmos.D16s". + :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :keyword instance_count: Instance count for the service. + :paramtype instance_count: int """ - super().__init__(**kwargs) - self.ip_address_or_range = ip_address_or_range + super().__init__( + additional_properties=additional_properties, + instance_size=instance_size, + instance_count=instance_count, + **kwargs + ) + self.service_type: str = "DataTransfer" + self.locations = None -class KeyWrapMetadata(_serialization.Model): - """Represents key wrap metadata that a key wrapping provider can use to wrap/unwrap a client - encryption key. +class ErrorAdditionalInfo(_serialization.Model): + """The resource management error additional info. - :ivar name: The name of associated KeyEncryptionKey (aka CustomerManagedKey). - :vartype name: str - :ivar type: ProviderName of KeyStoreProvider. + 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 value: Reference / link to the KeyEncryptionKey. - :vartype value: str - :ivar algorithm: Algorithm used in wrapping and unwrapping of the data encryption key. - :vartype algorithm: str + :ivar info: The additional info. + :vartype info: JSON """ + _validation = { + "type": {"readonly": True}, + "info": {"readonly": True}, + } + _attribute_map = { - "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "value": {"key": "value", "type": "str"}, - "algorithm": {"key": "algorithm", "type": "str"}, + "info": {"key": "info", "type": "object"}, } - def __init__( - self, - *, - name: Optional[str] = None, - type: Optional[str] = None, - value: Optional[str] = None, - algorithm: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: The name of associated KeyEncryptionKey (aka CustomerManagedKey). - :paramtype name: str - :keyword type: ProviderName of KeyStoreProvider. - :paramtype type: str - :keyword value: Reference / link to the KeyEncryptionKey. - :paramtype value: str - :keyword algorithm: Algorithm used in wrapping and unwrapping of the data encryption key. - :paramtype algorithm: str - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.name = name - self.type = type - self.value = value - self.algorithm = algorithm + self.type = None + self.info = None -class ListBackups(_serialization.Model): - """List of restorable backups for a Cassandra cluster. +class ErrorDetail(_serialization.Model): + """The error detail. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: Container for array of backups. - :vartype value: list[~azure.mgmt.cosmosdb.models.BackupResource] + :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.cosmosdb.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.cosmosdb.models.ErrorAdditionalInfo] """ _validation = { - "value": {"readonly": True}, + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, } _attribute_map = { - "value": {"key": "value", "type": "[BackupResource]"}, + "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.value = None + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None -class ListClusters(_serialization.Model): - """List of managed Cassandra clusters. +class ErrorResponse(_serialization.Model): + """Error Response. - :ivar value: Container for the array of clusters. - :vartype value: list[~azure.mgmt.cosmosdb.models.ClusterResource] + :ivar code: Error code. + :vartype code: str + :ivar message: Error message indicating why the operation failed. + :vartype message: str """ _attribute_map = { - "value": {"key": "value", "type": "[ClusterResource]"}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.ClusterResource"]] = None, **kwargs: Any) -> None: + def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None, **kwargs: Any) -> None: """ - :keyword value: Container for the array of clusters. - :paramtype value: list[~azure.mgmt.cosmosdb.models.ClusterResource] + :keyword code: Error code. + :paramtype code: str + :keyword message: Error message indicating why the operation failed. + :paramtype message: str """ super().__init__(**kwargs) - self.value = value - + self.code = code + self.message = message -class ListCommands(_serialization.Model): - """List of commands for cluster. - Variables are only populated by the server, and will be ignored when sending a request. +class ErrorResponseAutoGenerated(_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 value: Container for array of commands. - :vartype value: list[~azure.mgmt.cosmosdb.models.CommandPublicResource] + :ivar error: The error object. + :vartype error: ~azure.mgmt.cosmosdb.models.ErrorDetail """ - _validation = { - "value": {"readonly": True}, + _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.cosmosdb.models.ErrorDetail + """ + super().__init__(**kwargs) + self.error = error + + +class ExcludedPath(_serialization.Model): + """ExcludedPath. + + :ivar path: The path for which the indexing behavior applies to. Index paths typically start + with root and end with wildcard (/path/*). + :vartype path: str + """ + _attribute_map = { - "value": {"key": "value", "type": "[CommandPublicResource]"}, + "path": {"key": "path", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, path: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword path: The path for which the indexing behavior applies to. Index paths typically start + with root and end with wildcard (/path/*). + :paramtype path: str + """ super().__init__(**kwargs) - self.value = None + self.path = path -class ListDataCenters(_serialization.Model): - """List of managed Cassandra data centers and their properties. +class FailoverPolicies(_serialization.Model): + """The list of new failover policies for the failover priority change. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to server. - :ivar value: Container for array of data centers. - :vartype value: list[~azure.mgmt.cosmosdb.models.DataCenterResource] + :ivar failover_policies: List of failover policies. Required. + :vartype failover_policies: list[~azure.mgmt.cosmosdb.models.FailoverPolicy] """ _validation = { - "value": {"readonly": True}, + "failover_policies": {"required": True}, } _attribute_map = { - "value": {"key": "value", "type": "[DataCenterResource]"}, + "failover_policies": {"key": "failoverPolicies", "type": "[FailoverPolicy]"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, failover_policies: List["_models.FailoverPolicy"], **kwargs: Any) -> None: + """ + :keyword failover_policies: List of failover policies. Required. + :paramtype failover_policies: list[~azure.mgmt.cosmosdb.models.FailoverPolicy] + """ super().__init__(**kwargs) - self.value = None + self.failover_policies = failover_policies -class Location(_serialization.Model): - """A region in which the Azure Cosmos DB database account is deployed. +class FailoverPolicy(_serialization.Model): + """The failover policy for a given region of a database account. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The unique identifier of the region within the database account. Example: - <accountName>-<locationName>. + :ivar id: The unique identifier of the region in which the database account replicates to. + Example: <accountName>-<locationName>. :vartype id: str - :ivar location_name: The name of the region. + :ivar location_name: The name of the region in which the database account exists. :vartype location_name: str - :ivar document_endpoint: The connection endpoint for the specific region. Example: - https://<accountName>-<locationName>.documents.azure.com:443/. - :vartype document_endpoint: str - :ivar provisioning_state: The provisioning state of the resource. - :vartype provisioning_state: str :ivar failover_priority: The failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. :vartype failover_priority: int - :ivar is_zone_redundant: Flag to indicate whether or not this region is an AvailabilityZone - region. - :vartype is_zone_redundant: bool """ _validation = { "id": {"readonly": True}, - "document_endpoint": {"readonly": True}, - "provisioning_state": {"readonly": True}, "failover_priority": {"minimum": 0}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "location_name": {"key": "locationName", "type": "str"}, - "document_endpoint": {"key": "documentEndpoint", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, "failover_priority": {"key": "failoverPriority", "type": "int"}, - "is_zone_redundant": {"key": "isZoneRedundant", "type": "bool"}, } def __init__( - self, - *, - location_name: Optional[str] = None, - failover_priority: Optional[int] = None, - is_zone_redundant: Optional[bool] = None, - **kwargs: Any + self, *, location_name: Optional[str] = None, failover_priority: Optional[int] = None, **kwargs: Any ) -> None: """ - :keyword location_name: The name of the region. + :keyword location_name: The name of the region in which the database account exists. :paramtype location_name: str :keyword failover_priority: The failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. :paramtype failover_priority: int - :keyword is_zone_redundant: Flag to indicate whether or not this region is an AvailabilityZone - region. - :paramtype is_zone_redundant: bool """ super().__init__(**kwargs) self.id = None self.location_name = location_name - self.document_endpoint = None - self.provisioning_state = None self.failover_priority = failover_priority - self.is_zone_redundant = is_zone_redundant -class LocationGetResult(ARMProxyResource): - """Cosmos DB location get result. +class FullTextPath(_serialization.Model): + """Represents the full text path specification. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to server. - :ivar id: The unique resource identifier of the database account. - :vartype id: str - :ivar name: The name of the database account. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar properties: Cosmos DB location metadata. - :vartype properties: ~azure.mgmt.cosmosdb.models.LocationProperties + :ivar path: The path to the full text field in the document. Required. + :vartype path: str + :ivar language: The language of the full text field in the document. + :vartype language: str """ _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, + "path": {"required": True}, } _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "properties": {"key": "properties", "type": "LocationProperties"}, + "path": {"key": "path", "type": "str"}, + "language": {"key": "language", "type": "str"}, } - def __init__(self, *, properties: Optional["_models.LocationProperties"] = None, **kwargs: Any) -> None: + def __init__(self, *, path: str, language: Optional[str] = None, **kwargs: Any) -> None: """ - :keyword properties: Cosmos DB location metadata. - :paramtype properties: ~azure.mgmt.cosmosdb.models.LocationProperties + :keyword path: The path to the full text field in the document. Required. + :paramtype path: str + :keyword language: The language of the full text field in the document. + :paramtype language: str """ super().__init__(**kwargs) - self.properties = properties + self.path = path + self.language = language -class LocationListResult(_serialization.Model): - """The List operation response, that contains Cosmos DB locations and their properties. +class FullTextPolicy(_serialization.Model): + """Cosmos DB FullText Policy. + + :ivar default_language: The default language for a full text paths. + :vartype default_language: str + :ivar full_text_paths: List of FullText Paths. + :vartype full_text_paths: list[~azure.mgmt.cosmosdb.models.FullTextPath] + """ + + _attribute_map = { + "default_language": {"key": "defaultLanguage", "type": "str"}, + "full_text_paths": {"key": "fullTextPaths", "type": "[FullTextPath]"}, + } + + def __init__( + self, + *, + default_language: Optional[str] = None, + full_text_paths: Optional[List["_models.FullTextPath"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword default_language: The default language for a full text paths. + :paramtype default_language: str + :keyword full_text_paths: List of FullText Paths. + :paramtype full_text_paths: list[~azure.mgmt.cosmosdb.models.FullTextPath] + """ + super().__init__(**kwargs) + self.default_language = default_language + self.full_text_paths = full_text_paths + + +class GraphAPIComputeRegionalServiceResource(RegionalServiceResource): + """Resource for a regional service location. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of Cosmos DB locations and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.LocationGetResult] + :ivar name: The regional service name. + :vartype name: str + :ivar location: The location name. + :vartype location: str + :ivar status: Describes the status of a service. Known values are: "Creating", "Running", + "Updating", "Deleting", "Error", and "Stopped". + :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus + :ivar graph_api_compute_endpoint: The regional endpoint for GraphAPICompute. + :vartype graph_api_compute_endpoint: str """ _validation = { - "value": {"readonly": True}, + "name": {"readonly": True}, + "location": {"readonly": True}, + "status": {"readonly": True}, + "graph_api_compute_endpoint": {"readonly": True}, } _attribute_map = { - "value": {"key": "value", "type": "[LocationGetResult]"}, + "name": {"key": "name", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "graph_api_compute_endpoint": {"key": "graphApiComputeEndpoint", "type": "str"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None - + self.graph_api_compute_endpoint = None -class LocationProperties(_serialization.Model): - """Cosmos DB location metadata. - Variables are only populated by the server, and will be ignored when sending a request. +class GraphAPIComputeServiceResource(_serialization.Model): + """Describes the service response property for GraphAPICompute. - :ivar supports_availability_zone: Flag indicating whether the location supports availability - zones or not. - :vartype supports_availability_zone: bool - :ivar is_residency_restricted: Flag indicating whether the location is residency sensitive. - :vartype is_residency_restricted: bool - :ivar backup_storage_redundancies: The properties of available backup storage redundancies. - :vartype backup_storage_redundancies: list[str or - ~azure.mgmt.cosmosdb.models.BackupStorageRedundancy] - :ivar is_subscription_region_access_allowed_for_regular: Flag indicating whether the - subscription have access in region for Non-Availability Zones. - :vartype is_subscription_region_access_allowed_for_regular: bool - :ivar is_subscription_region_access_allowed_for_az: Flag indicating whether the subscription - have access in region for Availability Zones(Az). - :vartype is_subscription_region_access_allowed_for_az: bool - :ivar status: Enum to indicate current buildout status of the region. Known values are: - "Uninitialized", "Initializing", "InternallyReady", "Online", "Deleting", "Succeeded", - "Failed", "Canceled", and "Updating". - :vartype status: str or ~azure.mgmt.cosmosdb.models.Status + :ivar properties: Properties for GraphAPIComputeServiceResource. + :vartype properties: ~azure.mgmt.cosmosdb.models.GraphAPIComputeServiceResourceProperties """ - _validation = { - "supports_availability_zone": {"readonly": True}, - "is_residency_restricted": {"readonly": True}, - "backup_storage_redundancies": {"readonly": True}, - "is_subscription_region_access_allowed_for_regular": {"readonly": True}, - "is_subscription_region_access_allowed_for_az": {"readonly": True}, - "status": {"readonly": True}, - } - _attribute_map = { - "supports_availability_zone": {"key": "supportsAvailabilityZone", "type": "bool"}, - "is_residency_restricted": {"key": "isResidencyRestricted", "type": "bool"}, - "backup_storage_redundancies": {"key": "backupStorageRedundancies", "type": "[str]"}, - "is_subscription_region_access_allowed_for_regular": { - "key": "isSubscriptionRegionAccessAllowedForRegular", - "type": "bool", - }, - "is_subscription_region_access_allowed_for_az": { - "key": "isSubscriptionRegionAccessAllowedForAz", - "type": "bool", - }, - "status": {"key": "status", "type": "str"}, + "properties": {"key": "properties", "type": "GraphAPIComputeServiceResourceProperties"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, *, properties: Optional["_models.GraphAPIComputeServiceResourceProperties"] = None, **kwargs: Any + ) -> None: + """ + :keyword properties: Properties for GraphAPIComputeServiceResource. + :paramtype properties: ~azure.mgmt.cosmosdb.models.GraphAPIComputeServiceResourceProperties + """ super().__init__(**kwargs) - self.supports_availability_zone = None - self.is_residency_restricted = None - self.backup_storage_redundancies = None - self.is_subscription_region_access_allowed_for_regular = None - self.is_subscription_region_access_allowed_for_az = None - self.status = None + self.properties = properties -class ManagedCassandraManagedServiceIdentity(_serialization.Model): - """Identity for the resource. +class GraphAPIComputeServiceResourceCreateUpdateProperties( + ServiceResourceCreateUpdateProperties +): # pylint: disable=name-too-long + """Properties for Create or Update request for GraphAPIComputeServiceResource. - 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 principal_id: The object id of the identity resource. - :vartype principal_id: str - :ivar tenant_id: The tenant id of the resource. - :vartype tenant_id: str - :ivar type: The type of the resource. Known values are: "SystemAssigned" and "None". - :vartype type: str or ~azure.mgmt.cosmosdb.models.ManagedCassandraResourceIdentityType + :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", + "Cosmos.D8s", and "Cosmos.D16s". + :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :ivar instance_count: Instance count for the service. + :vartype instance_count: int + :ivar service_type: ServiceType for the service. Required. Known values are: + "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". + :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType """ _validation = { - "principal_id": {"readonly": True}, - "tenant_id": {"readonly": True}, + "instance_count": {"minimum": 0}, + "service_type": {"required": True}, } _attribute_map = { - "principal_id": {"key": "principalId", "type": "str"}, - "tenant_id": {"key": "tenantId", "type": "str"}, - "type": {"key": "type", "type": "str"}, + "instance_size": {"key": "instanceSize", "type": "str"}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "service_type": {"key": "serviceType", "type": "str"}, } def __init__( - self, *, type: Optional[Union[str, "_models.ManagedCassandraResourceIdentityType"]] = None, **kwargs: Any + self, + *, + instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, + instance_count: Optional[int] = None, + **kwargs: Any ) -> None: """ - :keyword type: The type of the resource. Known values are: "SystemAssigned" and "None". - :paramtype type: str or ~azure.mgmt.cosmosdb.models.ManagedCassandraResourceIdentityType + :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", + "Cosmos.D8s", and "Cosmos.D16s". + :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :keyword instance_count: Instance count for the service. + :paramtype instance_count: int """ - super().__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = type + super().__init__(instance_size=instance_size, instance_count=instance_count, **kwargs) + self.service_type: str = "GraphAPICompute" -class ManagedCassandraReaperStatus(_serialization.Model): - """ManagedCassandraReaperStatus. +class GraphAPIComputeServiceResourceProperties(ServiceResourceProperties): + """Properties for GraphAPIComputeServiceResource. - :ivar healthy: - :vartype healthy: bool - :ivar repair_run_ids: Dictionary of :code:``. - :vartype repair_run_ids: dict[str, str] - :ivar repair_schedules: Dictionary of :code:``. - :vartype repair_schedules: dict[str, str] + 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 additional_properties: Unmatched properties from the message are deserialized to this + collection. + :vartype additional_properties: dict[str, any] + :ivar creation_time: Time of the last state change (ISO-8601 format). + :vartype creation_time: ~datetime.datetime + :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", + "Cosmos.D8s", and "Cosmos.D16s". + :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :ivar instance_count: Instance count for the service. + :vartype instance_count: int + :ivar service_type: ServiceType for the service. Required. Known values are: + "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". + :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType + :ivar status: Describes the status of a service. Known values are: "Creating", "Running", + "Updating", "Deleting", "Error", and "Stopped". + :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus + :ivar graph_api_compute_endpoint: GraphAPICompute endpoint for the service. + :vartype graph_api_compute_endpoint: str + :ivar locations: An array that contains all of the locations for the service. + :vartype locations: list[~azure.mgmt.cosmosdb.models.GraphAPIComputeRegionalServiceResource] """ + _validation = { + "creation_time": {"readonly": True}, + "instance_count": {"minimum": 0}, + "service_type": {"required": True}, + "status": {"readonly": True}, + "locations": {"readonly": True}, + } + _attribute_map = { - "healthy": {"key": "healthy", "type": "bool"}, - "repair_run_ids": {"key": "repairRunIds", "type": "{str}"}, - "repair_schedules": {"key": "repairSchedules", "type": "{str}"}, + "additional_properties": {"key": "", "type": "{object}"}, + "creation_time": {"key": "creationTime", "type": "iso-8601"}, + "instance_size": {"key": "instanceSize", "type": "str"}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "service_type": {"key": "serviceType", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "graph_api_compute_endpoint": {"key": "graphApiComputeEndpoint", "type": "str"}, + "locations": {"key": "locations", "type": "[GraphAPIComputeRegionalServiceResource]"}, } def __init__( self, *, - healthy: Optional[bool] = None, - repair_run_ids: Optional[Dict[str, str]] = None, - repair_schedules: Optional[Dict[str, str]] = None, + additional_properties: Optional[Dict[str, Any]] = None, + instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, + instance_count: Optional[int] = None, + graph_api_compute_endpoint: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword healthy: - :paramtype healthy: bool - :keyword repair_run_ids: Dictionary of :code:``. - :paramtype repair_run_ids: dict[str, str] - :keyword repair_schedules: Dictionary of :code:``. - :paramtype repair_schedules: dict[str, str] + :keyword additional_properties: Unmatched properties from the message are deserialized to this + collection. + :paramtype additional_properties: dict[str, any] + :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", + "Cosmos.D8s", and "Cosmos.D16s". + :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :keyword instance_count: Instance count for the service. + :paramtype instance_count: int + :keyword graph_api_compute_endpoint: GraphAPICompute endpoint for the service. + :paramtype graph_api_compute_endpoint: str """ - super().__init__(**kwargs) - self.healthy = healthy - self.repair_run_ids = repair_run_ids - self.repair_schedules = repair_schedules + super().__init__( + additional_properties=additional_properties, + instance_size=instance_size, + instance_count=instance_count, + **kwargs + ) + self.service_type: str = "GraphAPICompute" + self.graph_api_compute_endpoint = graph_api_compute_endpoint + self.locations = None -class ManagedServiceIdentity(_serialization.Model): - """Identity for the resource. +class GremlinDatabaseCreateUpdateParameters(ARMResourceProperties): + """Parameters to create and update Cosmos DB Gremlin database. Variables are only populated by the server, and will be ignored when sending a request. - :ivar principal_id: The principal id of the system assigned identity. This property will only - be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant id of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' - includes both an implicitly created identity and a set of user assigned identities. The type - 'None' will remove any identities from the service. Known values are: "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned", and "None". - :vartype type: str or ~azure.mgmt.cosmosdb.models.ResourceIdentityType - :ivar user_assigned_identities: The list of user identities associated with resource. The user - identity dictionary key references will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. # pylint: disable=line-too-long - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.cosmosdb.models.ManagedServiceIdentityUserAssignedIdentity] + All required parameters must be populated in order to send to server. + + :ivar id: The unique resource identifier of the ARM resource. + :vartype id: str + :ivar name: The name of the ARM resource. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :ivar location: The location of the resource group to which the resource belongs. + :vartype location: str + :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :vartype tags: dict[str, str] + :ivar resource: The standard JSON format of a Gremlin database. Required. + :vartype resource: ~azure.mgmt.cosmosdb.models.GremlinDatabaseResource + :ivar options: A key-value pair of options to be applied for the request. This corresponds to + the headers sent with the request. + :vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ _validation = { - "principal_id": {"readonly": True}, - "tenant_id": {"readonly": True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "resource": {"required": True}, } _attribute_map = { - "principal_id": {"key": "principalId", "type": "str"}, - "tenant_id": {"key": "tenantId", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "user_assigned_identities": { - "key": "userAssignedIdentities", - "type": "{ManagedServiceIdentityUserAssignedIdentity}", - }, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "resource": {"key": "properties.resource", "type": "GremlinDatabaseResource"}, + "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, } def __init__( self, *, - type: Optional[Union[str, "_models.ResourceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, "_models.ManagedServiceIdentityUserAssignedIdentity"]] = None, + resource: "_models.GremlinDatabaseResource", + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + options: Optional["_models.CreateUpdateOptions"] = None, **kwargs: Any ) -> None: """ - :keyword type: The type of identity used for the resource. The type - 'SystemAssigned,UserAssigned' includes both an implicitly created identity and a set of user - assigned identities. The type 'None' will remove any identities from the service. Known values - are: "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned", and "None". - :paramtype type: str or ~azure.mgmt.cosmosdb.models.ResourceIdentityType - :keyword user_assigned_identities: The list of user identities associated with resource. The - user identity dictionary key references will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. # pylint: disable=line-too-long - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.cosmosdb.models.ManagedServiceIdentityUserAssignedIdentity] + :keyword location: The location of the resource group to which the resource belongs. + :paramtype location: str + :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :paramtype tags: dict[str, str] + :keyword resource: The standard JSON format of a Gremlin database. Required. + :paramtype resource: ~azure.mgmt.cosmosdb.models.GremlinDatabaseResource + :keyword options: A key-value pair of options to be applied for the request. This corresponds + to the headers sent with the request. + :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ - super().__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = type - self.user_assigned_identities = user_assigned_identities + super().__init__(location=location, tags=tags, **kwargs) + self.resource = resource + self.options = options -class ManagedServiceIdentityUserAssignedIdentity(_serialization.Model): # pylint: disable=name-too-long - """ManagedServiceIdentityUserAssignedIdentity. +class GremlinDatabaseGetPropertiesOptions(OptionsResource): + """GremlinDatabaseGetPropertiesOptions. - Variables are only populated by the server, and will be ignored when sending a request. + :ivar throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the + ThroughputSetting resource when retrieving offer details. + :vartype throughput: int + :ivar autoscale_settings: Specifies the Autoscale settings. + :vartype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings + """ - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str + +class GremlinDatabaseResource(_serialization.Model): + """Cosmos DB Gremlin database resource object. + + All required parameters must be populated in order to send to server. + + :ivar id: Name of the Cosmos DB Gremlin database. Required. + :vartype id: str + :ivar restore_parameters: Parameters to indicate the information about the restore. + :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" + and "Restore". + :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode """ _validation = { - "principal_id": {"readonly": True}, - "client_id": {"readonly": True}, + "id": {"required": True}, } _attribute_map = { - "principal_id": {"key": "principalId", "type": "str"}, - "client_id": {"key": "clientId", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, + "create_mode": {"key": "createMode", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, + create_mode: Union[str, "_models.CreateMode"] = "Default", + **kwargs: Any + ) -> None: + """ + :keyword id: Name of the Cosmos DB Gremlin database. Required. + :paramtype id: str + :keyword restore_parameters: Parameters to indicate the information about the restore. + :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: + "Default" and "Restore". + :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + """ super().__init__(**kwargs) - self.principal_id = None - self.client_id = None + self.id = id + self.restore_parameters = restore_parameters + self.create_mode = create_mode -class MaterializedViewDefinition(_serialization.Model): - """Materialized View definition for the container. +class GremlinDatabaseGetPropertiesResource(GremlinDatabaseResource, ExtendedResourceProperties): + """GremlinDatabaseGetPropertiesResource. 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 source_collection_rid: An unique identifier for the source collection. This is a system - generated property. - :vartype source_collection_rid: str - :ivar source_collection_id: The name of the source container on which the Materialized View - will be created. Required. - :vartype source_collection_id: str - :ivar definition: The definition should be an SQL query which would be used to fetch data from - the source container to populate into the Materialized View container. Required. - :vartype definition: str + :ivar rid: A system generated property. A unique identifier. + :vartype rid: str + :ivar ts: A system generated property that denotes the last updated timestamp of the resource. + :vartype ts: float + :ivar etag: A system generated property representing the resource etag required for optimistic + concurrency control. + :vartype etag: str + :ivar id: Name of the Cosmos DB Gremlin database. Required. + :vartype id: str + :ivar restore_parameters: Parameters to indicate the information about the restore. + :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" + and "Restore". + :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode """ _validation = { - "source_collection_rid": {"readonly": True}, - "source_collection_id": {"required": True}, - "definition": {"required": True}, + "rid": {"readonly": True}, + "ts": {"readonly": True}, + "etag": {"readonly": True}, + "id": {"required": True}, } _attribute_map = { - "source_collection_rid": {"key": "sourceCollectionRid", "type": "str"}, - "source_collection_id": {"key": "sourceCollectionId", "type": "str"}, - "definition": {"key": "definition", "type": "str"}, + "rid": {"key": "_rid", "type": "str"}, + "ts": {"key": "_ts", "type": "float"}, + "etag": {"key": "_etag", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, + "create_mode": {"key": "createMode", "type": "str"}, } - def __init__(self, *, source_collection_id: str, definition: str, **kwargs: Any) -> None: + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, + create_mode: Union[str, "_models.CreateMode"] = "Default", + **kwargs: Any + ) -> None: """ - :keyword source_collection_id: The name of the source container on which the Materialized View - will be created. Required. - :paramtype source_collection_id: str - :keyword definition: The definition should be an SQL query which would be used to fetch data - from the source container to populate into the Materialized View container. Required. - :paramtype definition: str + :keyword id: Name of the Cosmos DB Gremlin database. Required. + :paramtype id: str + :keyword restore_parameters: Parameters to indicate the information about the restore. + :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: + "Default" and "Restore". + :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode """ - super().__init__(**kwargs) - self.source_collection_rid = None - self.source_collection_id = source_collection_id - self.definition = definition + super().__init__(id=id, restore_parameters=restore_parameters, create_mode=create_mode, **kwargs) + self.rid = None + self.ts = None + self.etag = None + self.id = id + self.restore_parameters = restore_parameters + self.create_mode = create_mode -class MaterializedViewsBuilderRegionalServiceResource(RegionalServiceResource): # pylint: disable=name-too-long - """Resource for a regional service location. +class GremlinDatabaseGetResults(ARMResourceProperties): + """An Azure Cosmos DB Gremlin database. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: The regional service name. + :ivar id: The unique resource identifier of the ARM resource. + :vartype id: str + :ivar name: The name of the ARM resource. :vartype name: str - :ivar location: The location name. + :ivar type: The type of Azure resource. + :vartype type: str + :ivar location: The location of the resource group to which the resource belongs. :vartype location: str - :ivar status: Describes the status of a service. Known values are: "Creating", "Running", - "Updating", "Deleting", "Error", and "Stopped". - :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus + :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :vartype tags: dict[str, str] + :ivar resource: + :vartype resource: ~azure.mgmt.cosmosdb.models.GremlinDatabaseGetPropertiesResource + :ivar options: + :vartype options: ~azure.mgmt.cosmosdb.models.GremlinDatabaseGetPropertiesOptions """ - -class MaterializedViewsBuilderServiceResource(_serialization.Model): - """Describes the service response property for MaterializedViewsBuilder. - - :ivar properties: Properties for MaterializedViewsBuilderServiceResource. - :vartype properties: - ~azure.mgmt.cosmosdb.models.MaterializedViewsBuilderServiceResourceProperties - """ + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + } _attribute_map = { - "properties": {"key": "properties", "type": "MaterializedViewsBuilderServiceResourceProperties"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "resource": {"key": "properties.resource", "type": "GremlinDatabaseGetPropertiesResource"}, + "options": {"key": "properties.options", "type": "GremlinDatabaseGetPropertiesOptions"}, } def __init__( - self, *, properties: Optional["_models.MaterializedViewsBuilderServiceResourceProperties"] = None, **kwargs: Any + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + resource: Optional["_models.GremlinDatabaseGetPropertiesResource"] = None, + options: Optional["_models.GremlinDatabaseGetPropertiesOptions"] = None, + **kwargs: Any ) -> None: """ - :keyword properties: Properties for MaterializedViewsBuilderServiceResource. - :paramtype properties: - ~azure.mgmt.cosmosdb.models.MaterializedViewsBuilderServiceResourceProperties + :keyword location: The location of the resource group to which the resource belongs. + :paramtype location: str + :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :paramtype tags: dict[str, str] + :keyword resource: + :paramtype resource: ~azure.mgmt.cosmosdb.models.GremlinDatabaseGetPropertiesResource + :keyword options: + :paramtype options: ~azure.mgmt.cosmosdb.models.GremlinDatabaseGetPropertiesOptions """ - super().__init__(**kwargs) - self.properties = properties + super().__init__(location=location, tags=tags, **kwargs) + self.resource = resource + self.options = options -class MaterializedViewsBuilderServiceResourceCreateUpdateProperties( - ServiceResourceCreateUpdateProperties -): # pylint: disable=name-too-long - """Properties for Create or Update request for MaterializedViewsBuilderServiceResource. +class GremlinDatabaseListResult(_serialization.Model): + """The List operation response, that contains the Gremlin databases and their properties. - All required parameters must be populated in order to send to server. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", - "Cosmos.D8s", and "Cosmos.D16s". - :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize - :ivar instance_count: Instance count for the service. - :vartype instance_count: int - :ivar service_type: ServiceType for the service. Required. Known values are: - "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". - :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType + :ivar value: List of Gremlin databases and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.GremlinDatabaseGetResults] """ _validation = { - "instance_count": {"minimum": 0}, - "service_type": {"required": True}, + "value": {"readonly": True}, } _attribute_map = { - "instance_size": {"key": "instanceSize", "type": "str"}, - "instance_count": {"key": "instanceCount", "type": "int"}, - "service_type": {"key": "serviceType", "type": "str"}, + "value": {"key": "value", "type": "[GremlinDatabaseGetResults]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None + + +class GremlinDatabaseRestoreResource(_serialization.Model): + """Specific Gremlin Databases to restore. + + :ivar database_name: The name of the gremlin database available for restore. + :vartype database_name: str + :ivar graph_names: The names of the graphs available for restore. + :vartype graph_names: list[str] + """ + + _attribute_map = { + "database_name": {"key": "databaseName", "type": "str"}, + "graph_names": {"key": "graphNames", "type": "[str]"}, } def __init__( - self, - *, - instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, - instance_count: Optional[int] = None, - **kwargs: Any + self, *, database_name: Optional[str] = None, graph_names: Optional[List[str]] = None, **kwargs: Any ) -> None: """ - :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", - "Cosmos.D8s", and "Cosmos.D16s". - :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize - :keyword instance_count: Instance count for the service. - :paramtype instance_count: int + :keyword database_name: The name of the gremlin database available for restore. + :paramtype database_name: str + :keyword graph_names: The names of the graphs available for restore. + :paramtype graph_names: list[str] """ - super().__init__(instance_size=instance_size, instance_count=instance_count, **kwargs) - self.service_type: str = "MaterializedViewsBuilder" + super().__init__(**kwargs) + self.database_name = database_name + self.graph_names = graph_names -class MaterializedViewsBuilderServiceResourceProperties(ServiceResourceProperties): # pylint: disable=name-too-long - """Properties for MaterializedViewsBuilderServiceResource. +class GremlinGraphCreateUpdateParameters(ARMResourceProperties): + """Parameters to create and update Cosmos DB Gremlin graph. 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 additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar creation_time: Time of the last state change (ISO-8601 format). - :vartype creation_time: ~datetime.datetime - :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", - "Cosmos.D8s", and "Cosmos.D16s". - :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize - :ivar instance_count: Instance count for the service. - :vartype instance_count: int - :ivar service_type: ServiceType for the service. Required. Known values are: - "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". - :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType - :ivar status: Describes the status of a service. Known values are: "Creating", "Running", - "Updating", "Deleting", "Error", and "Stopped". - :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus - :ivar locations: An array that contains all of the locations for the service. - :vartype locations: - list[~azure.mgmt.cosmosdb.models.MaterializedViewsBuilderRegionalServiceResource] + :ivar id: The unique resource identifier of the ARM resource. + :vartype id: str + :ivar name: The name of the ARM resource. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :ivar location: The location of the resource group to which the resource belongs. + :vartype location: str + :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :vartype tags: dict[str, str] + :ivar resource: The standard JSON format of a Gremlin graph. Required. + :vartype resource: ~azure.mgmt.cosmosdb.models.GremlinGraphResource + :ivar options: A key-value pair of options to be applied for the request. This corresponds to + the headers sent with the request. + :vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ _validation = { - "creation_time": {"readonly": True}, - "instance_count": {"minimum": 0}, - "service_type": {"required": True}, - "status": {"readonly": True}, - "locations": {"readonly": True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "resource": {"required": True}, } _attribute_map = { - "additional_properties": {"key": "", "type": "{object}"}, - "creation_time": {"key": "creationTime", "type": "iso-8601"}, - "instance_size": {"key": "instanceSize", "type": "str"}, - "instance_count": {"key": "instanceCount", "type": "int"}, - "service_type": {"key": "serviceType", "type": "str"}, - "status": {"key": "status", "type": "str"}, - "locations": {"key": "locations", "type": "[MaterializedViewsBuilderRegionalServiceResource]"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "resource": {"key": "properties.resource", "type": "GremlinGraphResource"}, + "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, } def __init__( self, *, - additional_properties: Optional[Dict[str, Any]] = None, - instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, - instance_count: Optional[int] = None, + resource: "_models.GremlinGraphResource", + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + options: Optional["_models.CreateUpdateOptions"] = None, **kwargs: Any ) -> None: """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", - "Cosmos.D8s", and "Cosmos.D16s". - :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize - :keyword instance_count: Instance count for the service. - :paramtype instance_count: int + :keyword location: The location of the resource group to which the resource belongs. + :paramtype location: str + :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :paramtype tags: dict[str, str] + :keyword resource: The standard JSON format of a Gremlin graph. Required. + :paramtype resource: ~azure.mgmt.cosmosdb.models.GremlinGraphResource + :keyword options: A key-value pair of options to be applied for the request. This corresponds + to the headers sent with the request. + :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ - super().__init__( - additional_properties=additional_properties, - instance_size=instance_size, - instance_count=instance_count, - **kwargs - ) - self.service_type: str = "MaterializedViewsBuilder" - self.locations = None + super().__init__(location=location, tags=tags, **kwargs) + self.resource = resource + self.options = options -class MergeParameters(_serialization.Model): - """The properties of an Azure Cosmos DB merge operations. +class GremlinGraphGetPropertiesOptions(OptionsResource): + """GremlinGraphGetPropertiesOptions. - :ivar is_dry_run: Specifies whether the operation is a real merge operation or a simulation. - :vartype is_dry_run: bool + :ivar throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the + ThroughputSetting resource when retrieving offer details. + :vartype throughput: int + :ivar autoscale_settings: Specifies the Autoscale settings. + :vartype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings """ - _attribute_map = { - "is_dry_run": {"key": "isDryRun", "type": "bool"}, - } - - def __init__(self, *, is_dry_run: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword is_dry_run: Specifies whether the operation is a real merge operation or a simulation. - :paramtype is_dry_run: bool - """ - super().__init__(**kwargs) - self.is_dry_run = is_dry_run - -class Metric(_serialization.Model): - """Metric data. +class GremlinGraphResource(_serialization.Model): + """Cosmos DB Gremlin graph resource object. - 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 start_time: The start time for the metric (ISO-8601 format). - :vartype start_time: ~datetime.datetime - :ivar end_time: The end time for the metric (ISO-8601 format). - :vartype end_time: ~datetime.datetime - :ivar time_grain: The time grain to be used to summarize the metric values. - :vartype time_grain: str - :ivar unit: The unit of the metric. Known values are: "Count", "Bytes", "Seconds", "Percent", - "CountPerSecond", "BytesPerSecond", and "Milliseconds". - :vartype unit: str or ~azure.mgmt.cosmosdb.models.UnitType - :ivar name: The name information for the metric. - :vartype name: ~azure.mgmt.cosmosdb.models.MetricName - :ivar metric_values: The metric values for the specified time window and timestep. - :vartype metric_values: list[~azure.mgmt.cosmosdb.models.MetricValue] + :ivar id: Name of the Cosmos DB Gremlin graph. Required. + :vartype id: str + :ivar indexing_policy: The configuration of the indexing policy. By default, the indexing is + automatic for all document paths within the graph. + :vartype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy + :ivar partition_key: The configuration of the partition key to be used for partitioning data + into multiple partitions. + :vartype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey + :ivar default_ttl: Default time to live. + :vartype default_ttl: int + :ivar unique_key_policy: The unique key policy configuration for specifying uniqueness + constraints on documents in the collection in the Azure Cosmos DB service. + :vartype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy + :ivar conflict_resolution_policy: The conflict resolution policy for the graph. + :vartype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy + :ivar analytical_storage_ttl: Analytical TTL. + :vartype analytical_storage_ttl: int + :ivar restore_parameters: Parameters to indicate the information about the restore. + :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" + and "Restore". + :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode """ _validation = { - "start_time": {"readonly": True}, - "end_time": {"readonly": True}, - "time_grain": {"readonly": True}, - "unit": {"readonly": True}, - "name": {"readonly": True}, - "metric_values": {"readonly": True}, + "id": {"required": True}, } _attribute_map = { - "start_time": {"key": "startTime", "type": "iso-8601"}, - "end_time": {"key": "endTime", "type": "iso-8601"}, - "time_grain": {"key": "timeGrain", "type": "str"}, - "unit": {"key": "unit", "type": "str"}, - "name": {"key": "name", "type": "MetricName"}, - "metric_values": {"key": "metricValues", "type": "[MetricValue]"}, + "id": {"key": "id", "type": "str"}, + "indexing_policy": {"key": "indexingPolicy", "type": "IndexingPolicy"}, + "partition_key": {"key": "partitionKey", "type": "ContainerPartitionKey"}, + "default_ttl": {"key": "defaultTtl", "type": "int"}, + "unique_key_policy": {"key": "uniqueKeyPolicy", "type": "UniqueKeyPolicy"}, + "conflict_resolution_policy": {"key": "conflictResolutionPolicy", "type": "ConflictResolutionPolicy"}, + "analytical_storage_ttl": {"key": "analyticalStorageTtl", "type": "int"}, + "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, + "create_mode": {"key": "createMode", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + indexing_policy: Optional["_models.IndexingPolicy"] = None, + partition_key: Optional["_models.ContainerPartitionKey"] = None, + default_ttl: Optional[int] = None, + unique_key_policy: Optional["_models.UniqueKeyPolicy"] = None, + conflict_resolution_policy: Optional["_models.ConflictResolutionPolicy"] = None, + analytical_storage_ttl: Optional[int] = None, + restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, + create_mode: Union[str, "_models.CreateMode"] = "Default", + **kwargs: Any + ) -> None: + """ + :keyword id: Name of the Cosmos DB Gremlin graph. Required. + :paramtype id: str + :keyword indexing_policy: The configuration of the indexing policy. By default, the indexing is + automatic for all document paths within the graph. + :paramtype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy + :keyword partition_key: The configuration of the partition key to be used for partitioning data + into multiple partitions. + :paramtype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey + :keyword default_ttl: Default time to live. + :paramtype default_ttl: int + :keyword unique_key_policy: The unique key policy configuration for specifying uniqueness + constraints on documents in the collection in the Azure Cosmos DB service. + :paramtype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy + :keyword conflict_resolution_policy: The conflict resolution policy for the graph. + :paramtype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy + :keyword analytical_storage_ttl: Analytical TTL. + :paramtype analytical_storage_ttl: int + :keyword restore_parameters: Parameters to indicate the information about the restore. + :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: + "Default" and "Restore". + :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + """ super().__init__(**kwargs) - self.start_time = None - self.end_time = None - self.time_grain = None - self.unit = None - self.name = None - self.metric_values = None + self.id = id + self.indexing_policy = indexing_policy + self.partition_key = partition_key + self.default_ttl = default_ttl + self.unique_key_policy = unique_key_policy + self.conflict_resolution_policy = conflict_resolution_policy + self.analytical_storage_ttl = analytical_storage_ttl + self.restore_parameters = restore_parameters + self.create_mode = create_mode -class MetricAvailability(_serialization.Model): - """The availability of the metric. +class GremlinGraphGetPropertiesResource(GremlinGraphResource, ExtendedResourceProperties): + """GremlinGraphGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar time_grain: The time grain to be used to summarize the metric values. - :vartype time_grain: str - :ivar retention: The retention for the metric values. - :vartype retention: str + All required parameters must be populated in order to send to server. + + :ivar rid: A system generated property. A unique identifier. + :vartype rid: str + :ivar ts: A system generated property that denotes the last updated timestamp of the resource. + :vartype ts: float + :ivar etag: A system generated property representing the resource etag required for optimistic + concurrency control. + :vartype etag: str + :ivar id: Name of the Cosmos DB Gremlin graph. Required. + :vartype id: str + :ivar indexing_policy: The configuration of the indexing policy. By default, the indexing is + automatic for all document paths within the graph. + :vartype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy + :ivar partition_key: The configuration of the partition key to be used for partitioning data + into multiple partitions. + :vartype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey + :ivar default_ttl: Default time to live. + :vartype default_ttl: int + :ivar unique_key_policy: The unique key policy configuration for specifying uniqueness + constraints on documents in the collection in the Azure Cosmos DB service. + :vartype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy + :ivar conflict_resolution_policy: The conflict resolution policy for the graph. + :vartype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy + :ivar analytical_storage_ttl: Analytical TTL. + :vartype analytical_storage_ttl: int + :ivar restore_parameters: Parameters to indicate the information about the restore. + :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" + and "Restore". + :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode """ _validation = { - "time_grain": {"readonly": True}, - "retention": {"readonly": True}, + "rid": {"readonly": True}, + "ts": {"readonly": True}, + "etag": {"readonly": True}, + "id": {"required": True}, } _attribute_map = { - "time_grain": {"key": "timeGrain", "type": "str"}, - "retention": {"key": "retention", "type": "str"}, + "rid": {"key": "_rid", "type": "str"}, + "ts": {"key": "_ts", "type": "float"}, + "etag": {"key": "_etag", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "indexing_policy": {"key": "indexingPolicy", "type": "IndexingPolicy"}, + "partition_key": {"key": "partitionKey", "type": "ContainerPartitionKey"}, + "default_ttl": {"key": "defaultTtl", "type": "int"}, + "unique_key_policy": {"key": "uniqueKeyPolicy", "type": "UniqueKeyPolicy"}, + "conflict_resolution_policy": {"key": "conflictResolutionPolicy", "type": "ConflictResolutionPolicy"}, + "analytical_storage_ttl": {"key": "analyticalStorageTtl", "type": "int"}, + "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, + "create_mode": {"key": "createMode", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.time_grain = None - self.retention = None + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + indexing_policy: Optional["_models.IndexingPolicy"] = None, + partition_key: Optional["_models.ContainerPartitionKey"] = None, + default_ttl: Optional[int] = None, + unique_key_policy: Optional["_models.UniqueKeyPolicy"] = None, + conflict_resolution_policy: Optional["_models.ConflictResolutionPolicy"] = None, + analytical_storage_ttl: Optional[int] = None, + restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, + create_mode: Union[str, "_models.CreateMode"] = "Default", + **kwargs: Any + ) -> None: + """ + :keyword id: Name of the Cosmos DB Gremlin graph. Required. + :paramtype id: str + :keyword indexing_policy: The configuration of the indexing policy. By default, the indexing is + automatic for all document paths within the graph. + :paramtype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy + :keyword partition_key: The configuration of the partition key to be used for partitioning data + into multiple partitions. + :paramtype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey + :keyword default_ttl: Default time to live. + :paramtype default_ttl: int + :keyword unique_key_policy: The unique key policy configuration for specifying uniqueness + constraints on documents in the collection in the Azure Cosmos DB service. + :paramtype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy + :keyword conflict_resolution_policy: The conflict resolution policy for the graph. + :paramtype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy + :keyword analytical_storage_ttl: Analytical TTL. + :paramtype analytical_storage_ttl: int + :keyword restore_parameters: Parameters to indicate the information about the restore. + :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: + "Default" and "Restore". + :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + """ + super().__init__( + id=id, + indexing_policy=indexing_policy, + partition_key=partition_key, + default_ttl=default_ttl, + unique_key_policy=unique_key_policy, + conflict_resolution_policy=conflict_resolution_policy, + analytical_storage_ttl=analytical_storage_ttl, + restore_parameters=restore_parameters, + create_mode=create_mode, + **kwargs + ) + self.rid = None + self.ts = None + self.etag = None + self.id = id + self.indexing_policy = indexing_policy + self.partition_key = partition_key + self.default_ttl = default_ttl + self.unique_key_policy = unique_key_policy + self.conflict_resolution_policy = conflict_resolution_policy + self.analytical_storage_ttl = analytical_storage_ttl + self.restore_parameters = restore_parameters + self.create_mode = create_mode -class MetricDefinition(_serialization.Model): - """The definition of a metric. +class GremlinGraphGetResults(ARMResourceProperties): + """An Azure Cosmos DB Gremlin graph. Variables are only populated by the server, and will be ignored when sending a request. - :ivar metric_availabilities: The list of metric availabilities for the account. - :vartype metric_availabilities: list[~azure.mgmt.cosmosdb.models.MetricAvailability] - :ivar primary_aggregation_type: The primary aggregation type of the metric. Known values are: - "None", "Average", "Total", "Minimum", "Maximum", and "Last". - :vartype primary_aggregation_type: str or ~azure.mgmt.cosmosdb.models.PrimaryAggregationType - :ivar unit: The unit of the metric. Known values are: "Count", "Bytes", "Seconds", "Percent", - "CountPerSecond", "BytesPerSecond", and "Milliseconds". - :vartype unit: str or ~azure.mgmt.cosmosdb.models.UnitType - :ivar resource_uri: The resource uri of the database. - :vartype resource_uri: str - :ivar name: The name information for the metric. - :vartype name: ~azure.mgmt.cosmosdb.models.MetricName + :ivar id: The unique resource identifier of the ARM resource. + :vartype id: str + :ivar name: The name of the ARM resource. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :ivar location: The location of the resource group to which the resource belongs. + :vartype location: str + :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :vartype tags: dict[str, str] + :ivar resource: + :vartype resource: ~azure.mgmt.cosmosdb.models.GremlinGraphGetPropertiesResource + :ivar options: + :vartype options: ~azure.mgmt.cosmosdb.models.GremlinGraphGetPropertiesOptions """ _validation = { - "metric_availabilities": {"readonly": True}, - "primary_aggregation_type": {"readonly": True}, - "unit": {"readonly": True}, - "resource_uri": {"readonly": True}, + "id": {"readonly": True}, "name": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { - "metric_availabilities": {"key": "metricAvailabilities", "type": "[MetricAvailability]"}, - "primary_aggregation_type": {"key": "primaryAggregationType", "type": "str"}, - "unit": {"key": "unit", "type": "str"}, - "resource_uri": {"key": "resourceUri", "type": "str"}, - "name": {"key": "name", "type": "MetricName"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "resource": {"key": "properties.resource", "type": "GremlinGraphGetPropertiesResource"}, + "options": {"key": "properties.options", "type": "GremlinGraphGetPropertiesOptions"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.metric_availabilities = None - self.primary_aggregation_type = None - self.unit = None - self.resource_uri = None - self.name = None + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + resource: Optional["_models.GremlinGraphGetPropertiesResource"] = None, + options: Optional["_models.GremlinGraphGetPropertiesOptions"] = None, + **kwargs: Any + ) -> None: + """ + :keyword location: The location of the resource group to which the resource belongs. + :paramtype location: str + :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :paramtype tags: dict[str, str] + :keyword resource: + :paramtype resource: ~azure.mgmt.cosmosdb.models.GremlinGraphGetPropertiesResource + :keyword options: + :paramtype options: ~azure.mgmt.cosmosdb.models.GremlinGraphGetPropertiesOptions + """ + super().__init__(location=location, tags=tags, **kwargs) + self.resource = resource + self.options = options -class MetricDefinitionsListResult(_serialization.Model): - """The response to a list metric definitions request. +class GremlinGraphListResult(_serialization.Model): + """The List operation response, that contains the graphs and their properties. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: The list of metric definitions for the account. - :vartype value: list[~azure.mgmt.cosmosdb.models.MetricDefinition] + :ivar value: List of graphs and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.GremlinGraphGetResults] """ _validation = { @@ -8803,7 +5856,7 @@ class MetricDefinitionsListResult(_serialization.Model): } _attribute_map = { - "value": {"key": "value", "type": "[MetricDefinition]"}, + "value": {"key": "value", "type": "[GremlinGraphGetResults]"}, } def __init__(self, **kwargs: Any) -> None: @@ -8812,386 +5865,352 @@ def __init__(self, **kwargs: Any) -> None: self.value = None -class MetricListResult(_serialization.Model): - """The response to a list metrics request. - - Variables are only populated by the server, and will be ignored when sending a request. +class IncludedPath(_serialization.Model): + """The paths that are included in indexing. - :ivar value: The list of metrics for the account. - :vartype value: list[~azure.mgmt.cosmosdb.models.Metric] + :ivar path: The path for which the indexing behavior applies to. Index paths typically start + with root and end with wildcard (/path/*). + :vartype path: str + :ivar indexes: List of indexes for this path. + :vartype indexes: list[~azure.mgmt.cosmosdb.models.Indexes] """ - _validation = { - "value": {"readonly": True}, - } - _attribute_map = { - "value": {"key": "value", "type": "[Metric]"}, + "path": {"key": "path", "type": "str"}, + "indexes": {"key": "indexes", "type": "[Indexes]"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, *, path: Optional[str] = None, indexes: Optional[List["_models.Indexes"]] = None, **kwargs: Any + ) -> None: + """ + :keyword path: The path for which the indexing behavior applies to. Index paths typically start + with root and end with wildcard (/path/*). + :paramtype path: str + :keyword indexes: List of indexes for this path. + :paramtype indexes: list[~azure.mgmt.cosmosdb.models.Indexes] + """ super().__init__(**kwargs) - self.value = None - + self.path = path + self.indexes = indexes -class MetricName(_serialization.Model): - """A metric name. - Variables are only populated by the server, and will be ignored when sending a request. +class Indexes(_serialization.Model): + """The indexes for the path. - :ivar value: The name of the metric. - :vartype value: str - :ivar localized_value: The friendly name of the metric. - :vartype localized_value: str + :ivar data_type: The datatype for which the indexing behavior is applied to. Known values are: + "String", "Number", "Point", "Polygon", "LineString", and "MultiPolygon". + :vartype data_type: str or ~azure.mgmt.cosmosdb.models.DataType + :ivar precision: The precision of the index. -1 is maximum precision. + :vartype precision: int + :ivar kind: Indicates the type of index. Known values are: "Hash", "Range", and "Spatial". + :vartype kind: str or ~azure.mgmt.cosmosdb.models.IndexKind """ - _validation = { - "value": {"readonly": True}, - "localized_value": {"readonly": True}, - } - _attribute_map = { - "value": {"key": "value", "type": "str"}, - "localized_value": {"key": "localizedValue", "type": "str"}, + "data_type": {"key": "dataType", "type": "str"}, + "precision": {"key": "precision", "type": "int"}, + "kind": {"key": "kind", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + data_type: Union[str, "_models.DataType"] = "String", + precision: Optional[int] = None, + kind: Union[str, "_models.IndexKind"] = "Hash", + **kwargs: Any + ) -> None: + """ + :keyword data_type: The datatype for which the indexing behavior is applied to. Known values + are: "String", "Number", "Point", "Polygon", "LineString", and "MultiPolygon". + :paramtype data_type: str or ~azure.mgmt.cosmosdb.models.DataType + :keyword precision: The precision of the index. -1 is maximum precision. + :paramtype precision: int + :keyword kind: Indicates the type of index. Known values are: "Hash", "Range", and "Spatial". + :paramtype kind: str or ~azure.mgmt.cosmosdb.models.IndexKind + """ super().__init__(**kwargs) - self.value = None - self.localized_value = None - + self.data_type = data_type + self.precision = precision + self.kind = kind -class MetricValue(_serialization.Model): - """Represents metrics values. - Variables are only populated by the server, and will be ignored when sending a request. +class IndexingPolicy(_serialization.Model): + """Cosmos DB indexing policy. - :ivar count: The number of values for the metric. - :vartype count: int - :ivar average: The average value of the metric. - :vartype average: float - :ivar maximum: The max value of the metric. - :vartype maximum: float - :ivar minimum: The min value of the metric. - :vartype minimum: float - :ivar timestamp: The metric timestamp (ISO-8601 format). - :vartype timestamp: ~datetime.datetime - :ivar total: The total value of the metric. - :vartype total: float + :ivar automatic: Indicates if the indexing policy is automatic. + :vartype automatic: bool + :ivar indexing_mode: Indicates the indexing mode. Known values are: "consistent", "lazy", and + "none". + :vartype indexing_mode: str or ~azure.mgmt.cosmosdb.models.IndexingMode + :ivar included_paths: List of paths to include in the indexing. + :vartype included_paths: list[~azure.mgmt.cosmosdb.models.IncludedPath] + :ivar excluded_paths: List of paths to exclude from indexing. + :vartype excluded_paths: list[~azure.mgmt.cosmosdb.models.ExcludedPath] + :ivar composite_indexes: List of composite path list. + :vartype composite_indexes: list[list[~azure.mgmt.cosmosdb.models.CompositePath]] + :ivar spatial_indexes: List of spatial specifics. + :vartype spatial_indexes: list[~azure.mgmt.cosmosdb.models.SpatialSpec] + :ivar vector_indexes: List of paths to include in the vector indexing. + :vartype vector_indexes: list[~azure.mgmt.cosmosdb.models.VectorIndex] """ - _validation = { - "count": {"readonly": True}, - "average": {"readonly": True}, - "maximum": {"readonly": True}, - "minimum": {"readonly": True}, - "timestamp": {"readonly": True}, - "total": {"readonly": True}, - } - _attribute_map = { - "count": {"key": "_count", "type": "int"}, - "average": {"key": "average", "type": "float"}, - "maximum": {"key": "maximum", "type": "float"}, - "minimum": {"key": "minimum", "type": "float"}, - "timestamp": {"key": "timestamp", "type": "iso-8601"}, - "total": {"key": "total", "type": "float"}, + "automatic": {"key": "automatic", "type": "bool"}, + "indexing_mode": {"key": "indexingMode", "type": "str"}, + "included_paths": {"key": "includedPaths", "type": "[IncludedPath]"}, + "excluded_paths": {"key": "excludedPaths", "type": "[ExcludedPath]"}, + "composite_indexes": {"key": "compositeIndexes", "type": "[[CompositePath]]"}, + "spatial_indexes": {"key": "spatialIndexes", "type": "[SpatialSpec]"}, + "vector_indexes": {"key": "vectorIndexes", "type": "[VectorIndex]"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + automatic: Optional[bool] = None, + indexing_mode: Union[str, "_models.IndexingMode"] = "consistent", + included_paths: Optional[List["_models.IncludedPath"]] = None, + excluded_paths: Optional[List["_models.ExcludedPath"]] = None, + composite_indexes: Optional[List[List["_models.CompositePath"]]] = None, + spatial_indexes: Optional[List["_models.SpatialSpec"]] = None, + vector_indexes: Optional[List["_models.VectorIndex"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword automatic: Indicates if the indexing policy is automatic. + :paramtype automatic: bool + :keyword indexing_mode: Indicates the indexing mode. Known values are: "consistent", "lazy", + and "none". + :paramtype indexing_mode: str or ~azure.mgmt.cosmosdb.models.IndexingMode + :keyword included_paths: List of paths to include in the indexing. + :paramtype included_paths: list[~azure.mgmt.cosmosdb.models.IncludedPath] + :keyword excluded_paths: List of paths to exclude from indexing. + :paramtype excluded_paths: list[~azure.mgmt.cosmosdb.models.ExcludedPath] + :keyword composite_indexes: List of composite path list. + :paramtype composite_indexes: list[list[~azure.mgmt.cosmosdb.models.CompositePath]] + :keyword spatial_indexes: List of spatial specifics. + :paramtype spatial_indexes: list[~azure.mgmt.cosmosdb.models.SpatialSpec] + :keyword vector_indexes: List of paths to include in the vector indexing. + :paramtype vector_indexes: list[~azure.mgmt.cosmosdb.models.VectorIndex] + """ super().__init__(**kwargs) - self.count = None - self.average = None - self.maximum = None - self.minimum = None - self.timestamp = None - self.total = None + self.automatic = automatic + self.indexing_mode = indexing_mode + self.included_paths = included_paths + self.excluded_paths = excluded_paths + self.composite_indexes = composite_indexes + self.spatial_indexes = spatial_indexes + self.vector_indexes = vector_indexes -class MongoDBCollectionCreateUpdateParameters(ARMResourceProperties): - """Parameters to create and update Cosmos DB MongoDB collection. +class IpAddressOrRange(_serialization.Model): + """IpAddressOrRange object. - Variables are only populated by the server, and will be ignored when sending a request. + :ivar ip_address_or_range: A single IPv4 address or a single IPv4 address range in CIDR format. + Provided IPs must be well-formatted and cannot be contained in one of the following ranges: + 10.0.0.0/8, 100.64.0.0/10, 172.16.0.0/12, 192.168.0.0/16, since these are not enforceable by + the IP address filter. Example of valid inputs: “23.40.210.245” or “23.40.210.0/8”. + :vartype ip_address_or_range: str + """ - All required parameters must be populated in order to send to server. + _attribute_map = { + "ip_address_or_range": {"key": "ipAddressOrRange", "type": "str"}, + } - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. + def __init__(self, *, ip_address_or_range: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword ip_address_or_range: A single IPv4 address or a single IPv4 address range in CIDR + format. Provided IPs must be well-formatted and cannot be contained in one of the following + ranges: 10.0.0.0/8, 100.64.0.0/10, 172.16.0.0/12, 192.168.0.0/16, since these are not + enforceable by the IP address filter. Example of valid inputs: “23.40.210.245” or + “23.40.210.0/8”. + :paramtype ip_address_or_range: str + """ + super().__init__(**kwargs) + self.ip_address_or_range = ip_address_or_range + + +class KeyWrapMetadata(_serialization.Model): + """Represents key wrap metadata that a key wrapping provider can use to wrap/unwrap a client + encryption key. + + :ivar name: The name of associated KeyEncryptionKey (aka CustomerManagedKey). :vartype name: str - :ivar type: The type of Azure resource. + :ivar type: ProviderName of KeyStoreProvider. :vartype type: str - :ivar location: The location of the resource group to which the resource belongs. - :vartype location: str - :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :ivar resource: The standard JSON format of a MongoDB collection. Required. - :vartype resource: ~azure.mgmt.cosmosdb.models.MongoDBCollectionResource - :ivar options: A key-value pair of options to be applied for the request. This corresponds to - the headers sent with the request. - :vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "resource": {"required": True}, - } + :ivar value: Reference / link to the KeyEncryptionKey. + :vartype value: str + :ivar algorithm: Algorithm used in wrapping and unwrapping of the data encryption key. + :vartype algorithm: str + """ _attribute_map = { - "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "resource": {"key": "properties.resource", "type": "MongoDBCollectionResource"}, - "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, + "value": {"key": "value", "type": "str"}, + "algorithm": {"key": "algorithm", "type": "str"}, } def __init__( self, *, - resource: "_models.MongoDBCollectionResource", - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - options: Optional["_models.CreateUpdateOptions"] = None, + name: Optional[str] = None, + type: Optional[str] = None, + value: Optional[str] = None, + algorithm: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :keyword resource: The standard JSON format of a MongoDB collection. Required. - :paramtype resource: ~azure.mgmt.cosmosdb.models.MongoDBCollectionResource - :keyword options: A key-value pair of options to be applied for the request. This corresponds - to the headers sent with the request. - :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions + :keyword name: The name of associated KeyEncryptionKey (aka CustomerManagedKey). + :paramtype name: str + :keyword type: ProviderName of KeyStoreProvider. + :paramtype type: str + :keyword value: Reference / link to the KeyEncryptionKey. + :paramtype value: str + :keyword algorithm: Algorithm used in wrapping and unwrapping of the data encryption key. + :paramtype algorithm: str """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.resource = resource - self.options = options + super().__init__(**kwargs) + self.name = name + self.type = type + self.value = value + self.algorithm = algorithm -class MongoDBCollectionGetPropertiesOptions(OptionsResource): - """MongoDBCollectionGetPropertiesOptions. +class ListClusters(_serialization.Model): + """List of managed Cassandra clusters. - :ivar throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the - ThroughputSetting resource when retrieving offer details. - :vartype throughput: int - :ivar autoscale_settings: Specifies the Autoscale settings. - :vartype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings + :ivar value: Container for the array of clusters. + :vartype value: list[~azure.mgmt.cosmosdb.models.ClusterResource] """ + _attribute_map = { + "value": {"key": "value", "type": "[ClusterResource]"}, + } + + def __init__(self, *, value: Optional[List["_models.ClusterResource"]] = None, **kwargs: Any) -> None: + """ + :keyword value: Container for the array of clusters. + :paramtype value: list[~azure.mgmt.cosmosdb.models.ClusterResource] + """ + super().__init__(**kwargs) + self.value = value -class MongoDBCollectionResource(_serialization.Model): - """Cosmos DB MongoDB collection resource object. - All required parameters must be populated in order to send to server. +class ListDataCenters(_serialization.Model): + """List of managed Cassandra data centers and their properties. - :ivar id: Name of the Cosmos DB MongoDB collection. Required. - :vartype id: str - :ivar shard_key: A key-value pair of shard keys to be applied for the request. - :vartype shard_key: dict[str, str] - :ivar indexes: List of index keys. - :vartype indexes: list[~azure.mgmt.cosmosdb.models.MongoIndex] - :ivar analytical_storage_ttl: Analytical TTL. - :vartype analytical_storage_ttl: int - :ivar restore_parameters: Parameters to indicate the information about the restore. - :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" - and "Restore". - :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Container for array of data centers. + :vartype value: list[~azure.mgmt.cosmosdb.models.DataCenterResource] """ _validation = { - "id": {"required": True}, + "value": {"readonly": True}, } _attribute_map = { - "id": {"key": "id", "type": "str"}, - "shard_key": {"key": "shardKey", "type": "{str}"}, - "indexes": {"key": "indexes", "type": "[MongoIndex]"}, - "analytical_storage_ttl": {"key": "analyticalStorageTtl", "type": "int"}, - "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, - "create_mode": {"key": "createMode", "type": "str"}, + "value": {"key": "value", "type": "[DataCenterResource]"}, } - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - shard_key: Optional[Dict[str, str]] = None, - indexes: Optional[List["_models.MongoIndex"]] = None, - analytical_storage_ttl: Optional[int] = None, - restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, - create_mode: Union[str, "_models.CreateMode"] = "Default", - **kwargs: Any - ) -> None: - """ - :keyword id: Name of the Cosmos DB MongoDB collection. Required. - :paramtype id: str - :keyword shard_key: A key-value pair of shard keys to be applied for the request. - :paramtype shard_key: dict[str, str] - :keyword indexes: List of index keys. - :paramtype indexes: list[~azure.mgmt.cosmosdb.models.MongoIndex] - :keyword analytical_storage_ttl: Analytical TTL. - :paramtype analytical_storage_ttl: int - :keyword restore_parameters: Parameters to indicate the information about the restore. - :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: - "Default" and "Restore". - :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.id = id - self.shard_key = shard_key - self.indexes = indexes - self.analytical_storage_ttl = analytical_storage_ttl - self.restore_parameters = restore_parameters - self.create_mode = create_mode + self.value = None -class MongoDBCollectionGetPropertiesResource(MongoDBCollectionResource, ExtendedResourceProperties): - """MongoDBCollectionGetPropertiesResource. +class Location(_serialization.Model): + """A region in which the Azure Cosmos DB database account is deployed. 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 rid: A system generated property. A unique identifier. - :vartype rid: str - :ivar ts: A system generated property that denotes the last updated timestamp of the resource. - :vartype ts: float - :ivar etag: A system generated property representing the resource etag required for optimistic - concurrency control. - :vartype etag: str - :ivar id: Name of the Cosmos DB MongoDB collection. Required. + :ivar id: The unique identifier of the region within the database account. Example: + <accountName>-<locationName>. :vartype id: str - :ivar shard_key: A key-value pair of shard keys to be applied for the request. - :vartype shard_key: dict[str, str] - :ivar indexes: List of index keys. - :vartype indexes: list[~azure.mgmt.cosmosdb.models.MongoIndex] - :ivar analytical_storage_ttl: Analytical TTL. - :vartype analytical_storage_ttl: int - :ivar restore_parameters: Parameters to indicate the information about the restore. - :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" - and "Restore". - :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :ivar location_name: The name of the region. + :vartype location_name: str + :ivar document_endpoint: The connection endpoint for the specific region. Example: + https://<accountName>-<locationName>.documents.azure.com:443/. + :vartype document_endpoint: str + :ivar provisioning_state: The status of the Cosmos DB account at the time the operation was + called. The status can be one of following. 'Creating' – the Cosmos DB account is being + created. When an account is in Creating state, only properties that are specified as input for + the Create Cosmos DB account operation are returned. 'Succeeded' – the Cosmos DB account is + active for use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB + account is being deleted. 'Failed' – the Cosmos DB account failed creation. 'DeletionFailed' – + the Cosmos DB account deletion failed. + :vartype provisioning_state: str + :ivar failover_priority: The failover priority of the region. A failover priority of 0 + indicates a write region. The maximum value for a failover priority = (total number of regions + - 1). Failover priority values must be unique for each of the regions in which the database + account exists. + :vartype failover_priority: int + :ivar is_zone_redundant: Flag to indicate whether or not this region is an AvailabilityZone + region. + :vartype is_zone_redundant: bool """ _validation = { - "rid": {"readonly": True}, - "ts": {"readonly": True}, - "etag": {"readonly": True}, - "id": {"required": True}, + "id": {"readonly": True}, + "document_endpoint": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "failover_priority": {"minimum": 0}, } _attribute_map = { - "rid": {"key": "_rid", "type": "str"}, - "ts": {"key": "_ts", "type": "float"}, - "etag": {"key": "_etag", "type": "str"}, "id": {"key": "id", "type": "str"}, - "shard_key": {"key": "shardKey", "type": "{str}"}, - "indexes": {"key": "indexes", "type": "[MongoIndex]"}, - "analytical_storage_ttl": {"key": "analyticalStorageTtl", "type": "int"}, - "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, - "create_mode": {"key": "createMode", "type": "str"}, + "location_name": {"key": "locationName", "type": "str"}, + "document_endpoint": {"key": "documentEndpoint", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "failover_priority": {"key": "failoverPriority", "type": "int"}, + "is_zone_redundant": {"key": "isZoneRedundant", "type": "bool"}, } def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - shard_key: Optional[Dict[str, str]] = None, - indexes: Optional[List["_models.MongoIndex"]] = None, - analytical_storage_ttl: Optional[int] = None, - restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, - create_mode: Union[str, "_models.CreateMode"] = "Default", + location_name: Optional[str] = None, + failover_priority: Optional[int] = None, + is_zone_redundant: Optional[bool] = None, **kwargs: Any ) -> None: """ - :keyword id: Name of the Cosmos DB MongoDB collection. Required. - :paramtype id: str - :keyword shard_key: A key-value pair of shard keys to be applied for the request. - :paramtype shard_key: dict[str, str] - :keyword indexes: List of index keys. - :paramtype indexes: list[~azure.mgmt.cosmosdb.models.MongoIndex] - :keyword analytical_storage_ttl: Analytical TTL. - :paramtype analytical_storage_ttl: int - :keyword restore_parameters: Parameters to indicate the information about the restore. - :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: - "Default" and "Restore". - :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :keyword location_name: The name of the region. + :paramtype location_name: str + :keyword failover_priority: The failover priority of the region. A failover priority of 0 + indicates a write region. The maximum value for a failover priority = (total number of regions + - 1). Failover priority values must be unique for each of the regions in which the database + account exists. + :paramtype failover_priority: int + :keyword is_zone_redundant: Flag to indicate whether or not this region is an AvailabilityZone + region. + :paramtype is_zone_redundant: bool """ - super().__init__( - id=id, - shard_key=shard_key, - indexes=indexes, - analytical_storage_ttl=analytical_storage_ttl, - restore_parameters=restore_parameters, - create_mode=create_mode, - **kwargs - ) - self.rid = None - self.ts = None - self.etag = None - self.id = id - self.shard_key = shard_key - self.indexes = indexes - self.analytical_storage_ttl = analytical_storage_ttl - self.restore_parameters = restore_parameters - self.create_mode = create_mode + super().__init__(**kwargs) + self.id = None + self.location_name = location_name + self.document_endpoint = None + self.provisioning_state = None + self.failover_priority = failover_priority + self.is_zone_redundant = is_zone_redundant -class MongoDBCollectionGetResults(ARMResourceProperties): - """An Azure Cosmos DB MongoDB collection. +class LocationGetResult(ARMProxyResource): + """Cosmos DB location get result. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The unique resource identifier of the ARM resource. + :ivar id: The unique resource identifier of the database account. :vartype id: str - :ivar name: The name of the ARM resource. + :ivar name: The name of the database account. :vartype name: str :ivar type: The type of Azure resource. :vartype type: str - :ivar location: The location of the resource group to which the resource belongs. - :vartype location: str - :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :ivar resource: - :vartype resource: ~azure.mgmt.cosmosdb.models.MongoDBCollectionGetPropertiesResource - :ivar options: - :vartype options: ~azure.mgmt.cosmosdb.models.MongoDBCollectionGetPropertiesOptions + :ivar properties: Cosmos DB location metadata. + :vartype properties: ~azure.mgmt.cosmosdb.models.LocationProperties """ _validation = { @@ -9204,52 +6223,25 @@ class MongoDBCollectionGetResults(ARMResourceProperties): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "resource": {"key": "properties.resource", "type": "MongoDBCollectionGetPropertiesResource"}, - "options": {"key": "properties.options", "type": "MongoDBCollectionGetPropertiesOptions"}, + "properties": {"key": "properties", "type": "LocationProperties"}, } - def __init__( - self, - *, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - resource: Optional["_models.MongoDBCollectionGetPropertiesResource"] = None, - options: Optional["_models.MongoDBCollectionGetPropertiesOptions"] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, properties: Optional["_models.LocationProperties"] = None, **kwargs: Any) -> None: """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :keyword resource: - :paramtype resource: ~azure.mgmt.cosmosdb.models.MongoDBCollectionGetPropertiesResource - :keyword options: - :paramtype options: ~azure.mgmt.cosmosdb.models.MongoDBCollectionGetPropertiesOptions + :keyword properties: Cosmos DB location metadata. + :paramtype properties: ~azure.mgmt.cosmosdb.models.LocationProperties """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.resource = resource - self.options = options + super().__init__(**kwargs) + self.properties = properties -class MongoDBCollectionListResult(_serialization.Model): - """The List operation response, that contains the MongoDB collections and their properties. +class LocationListResult(_serialization.Model): + """The List operation response, that contains Cosmos DB locations and their properties. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of MongoDB collections and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] + :ivar value: List of Cosmos DB locations and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.LocationGetResult] """ _validation = { @@ -9257,7 +6249,7 @@ class MongoDBCollectionListResult(_serialization.Model): } _attribute_map = { - "value": {"key": "value", "type": "[MongoDBCollectionGetResults]"}, + "value": {"key": "value", "type": "[LocationGetResult]"}, } def __init__(self, **kwargs: Any) -> None: @@ -9266,1339 +6258,1256 @@ def __init__(self, **kwargs: Any) -> None: self.value = None -class MongoDBDatabaseCreateUpdateParameters(ARMResourceProperties): - """Parameters to create and update Cosmos DB MongoDB database. +class LocationProperties(_serialization.Model): + """Cosmos DB location metadata. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to server. - - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar location: The location of the resource group to which the resource belongs. - :vartype location: str - :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :ivar resource: The standard JSON format of a MongoDB database. Required. - :vartype resource: ~azure.mgmt.cosmosdb.models.MongoDBDatabaseResource - :ivar options: A key-value pair of options to be applied for the request. This corresponds to - the headers sent with the request. - :vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions + :ivar supports_availability_zone: Flag indicating whether the location supports availability + zones or not. + :vartype supports_availability_zone: bool + :ivar is_residency_restricted: Flag indicating whether the location is residency sensitive. + :vartype is_residency_restricted: bool + :ivar backup_storage_redundancies: The properties of available backup storage redundancies. + :vartype backup_storage_redundancies: list[str or + ~azure.mgmt.cosmosdb.models.BackupStorageRedundancy] + :ivar is_subscription_region_access_allowed_for_regular: Flag indicating whether the + subscription have access in region for Non-Availability Zones. + :vartype is_subscription_region_access_allowed_for_regular: bool + :ivar is_subscription_region_access_allowed_for_az: Flag indicating whether the subscription + have access in region for Availability Zones(Az). + :vartype is_subscription_region_access_allowed_for_az: bool + :ivar status: Enum to indicate current buildout status of the region. Known values are: + "Uninitialized", "Initializing", "InternallyReady", "Online", and "Deleting". + :vartype status: str or ~azure.mgmt.cosmosdb.models.Status """ _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "resource": {"required": True}, + "supports_availability_zone": {"readonly": True}, + "is_residency_restricted": {"readonly": True}, + "backup_storage_redundancies": {"readonly": True}, + "is_subscription_region_access_allowed_for_regular": {"readonly": True}, + "is_subscription_region_access_allowed_for_az": {"readonly": True}, + "status": {"readonly": True}, } _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "resource": {"key": "properties.resource", "type": "MongoDBDatabaseResource"}, - "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, + "supports_availability_zone": {"key": "supportsAvailabilityZone", "type": "bool"}, + "is_residency_restricted": {"key": "isResidencyRestricted", "type": "bool"}, + "backup_storage_redundancies": {"key": "backupStorageRedundancies", "type": "[str]"}, + "is_subscription_region_access_allowed_for_regular": { + "key": "isSubscriptionRegionAccessAllowedForRegular", + "type": "bool", + }, + "is_subscription_region_access_allowed_for_az": { + "key": "isSubscriptionRegionAccessAllowedForAz", + "type": "bool", + }, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - *, - resource: "_models.MongoDBDatabaseResource", - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - options: Optional["_models.CreateUpdateOptions"] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :keyword resource: The standard JSON format of a MongoDB database. Required. - :paramtype resource: ~azure.mgmt.cosmosdb.models.MongoDBDatabaseResource - :keyword options: A key-value pair of options to be applied for the request. This corresponds - to the headers sent with the request. - :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions - """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.resource = resource - self.options = options - - -class MongoDBDatabaseGetPropertiesOptions(OptionsResource): - """MongoDBDatabaseGetPropertiesOptions. - - :ivar throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the - ThroughputSetting resource when retrieving offer details. - :vartype throughput: int - :ivar autoscale_settings: Specifies the Autoscale settings. - :vartype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings - """ + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.supports_availability_zone = None + self.is_residency_restricted = None + self.backup_storage_redundancies = None + self.is_subscription_region_access_allowed_for_regular = None + self.is_subscription_region_access_allowed_for_az = None + self.status = None -class MongoDBDatabaseResource(_serialization.Model): - """Cosmos DB MongoDB database resource object. +class ManagedCassandraManagedServiceIdentity(_serialization.Model): + """Identity for the resource. - All required parameters must be populated in order to send to server. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Name of the Cosmos DB MongoDB database. Required. - :vartype id: str - :ivar restore_parameters: Parameters to indicate the information about the restore. - :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" - and "Restore". - :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :ivar principal_id: The object id of the identity resource. + :vartype principal_id: str + :ivar tenant_id: The tenant id of the resource. + :vartype tenant_id: str + :ivar type: The type of the resource. Known values are: "SystemAssigned" and "None". + :vartype type: str or ~azure.mgmt.cosmosdb.models.ManagedCassandraResourceIdentityType """ _validation = { - "id": {"required": True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, } _attribute_map = { - "id": {"key": "id", "type": "str"}, - "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, - "create_mode": {"key": "createMode", "type": "str"}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, } def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, - create_mode: Union[str, "_models.CreateMode"] = "Default", - **kwargs: Any + self, *, type: Optional[Union[str, "_models.ManagedCassandraResourceIdentityType"]] = None, **kwargs: Any ) -> None: """ - :keyword id: Name of the Cosmos DB MongoDB database. Required. - :paramtype id: str - :keyword restore_parameters: Parameters to indicate the information about the restore. - :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: - "Default" and "Restore". - :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :keyword type: The type of the resource. Known values are: "SystemAssigned" and "None". + :paramtype type: str or ~azure.mgmt.cosmosdb.models.ManagedCassandraResourceIdentityType """ super().__init__(**kwargs) - self.id = id - self.restore_parameters = restore_parameters - self.create_mode = create_mode - - -class MongoDBDatabaseGetPropertiesResource(MongoDBDatabaseResource, ExtendedResourceProperties): - """MongoDBDatabaseGetPropertiesResource. + self.principal_id = None + self.tenant_id = None + self.type = type - 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. +class ManagedCassandraReaperStatus(_serialization.Model): + """ManagedCassandraReaperStatus. - :ivar rid: A system generated property. A unique identifier. - :vartype rid: str - :ivar ts: A system generated property that denotes the last updated timestamp of the resource. - :vartype ts: float - :ivar etag: A system generated property representing the resource etag required for optimistic - concurrency control. - :vartype etag: str - :ivar id: Name of the Cosmos DB MongoDB database. Required. - :vartype id: str - :ivar restore_parameters: Parameters to indicate the information about the restore. - :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" - and "Restore". - :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :ivar healthy: + :vartype healthy: bool + :ivar repair_run_ids: Dictionary of :code:``. + :vartype repair_run_ids: dict[str, str] + :ivar repair_schedules: Dictionary of :code:``. + :vartype repair_schedules: dict[str, str] """ - _validation = { - "rid": {"readonly": True}, - "ts": {"readonly": True}, - "etag": {"readonly": True}, - "id": {"required": True}, - } - _attribute_map = { - "rid": {"key": "_rid", "type": "str"}, - "ts": {"key": "_ts", "type": "float"}, - "etag": {"key": "_etag", "type": "str"}, - "id": {"key": "id", "type": "str"}, - "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, - "create_mode": {"key": "createMode", "type": "str"}, + "healthy": {"key": "healthy", "type": "bool"}, + "repair_run_ids": {"key": "repairRunIds", "type": "{str}"}, + "repair_schedules": {"key": "repairSchedules", "type": "{str}"}, } def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, - create_mode: Union[str, "_models.CreateMode"] = "Default", + healthy: Optional[bool] = None, + repair_run_ids: Optional[Dict[str, str]] = None, + repair_schedules: Optional[Dict[str, str]] = None, **kwargs: Any ) -> None: """ - :keyword id: Name of the Cosmos DB MongoDB database. Required. - :paramtype id: str - :keyword restore_parameters: Parameters to indicate the information about the restore. - :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: - "Default" and "Restore". - :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :keyword healthy: + :paramtype healthy: bool + :keyword repair_run_ids: Dictionary of :code:``. + :paramtype repair_run_ids: dict[str, str] + :keyword repair_schedules: Dictionary of :code:``. + :paramtype repair_schedules: dict[str, str] """ - super().__init__(id=id, restore_parameters=restore_parameters, create_mode=create_mode, **kwargs) - self.rid = None - self.ts = None - self.etag = None - self.id = id - self.restore_parameters = restore_parameters - self.create_mode = create_mode + super().__init__(**kwargs) + self.healthy = healthy + self.repair_run_ids = repair_run_ids + self.repair_schedules = repair_schedules -class MongoDBDatabaseGetResults(ARMResourceProperties): - """An Azure Cosmos DB MongoDB database. +class ManagedServiceIdentity(_serialization.Model): + """Identity for the resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar location: The location of the resource group to which the resource belongs. - :vartype location: str - :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :ivar resource: - :vartype resource: ~azure.mgmt.cosmosdb.models.MongoDBDatabaseGetPropertiesResource - :ivar options: - :vartype options: ~azure.mgmt.cosmosdb.models.MongoDBDatabaseGetPropertiesOptions + :ivar principal_id: The principal id of the system assigned identity. This property will only + be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant id of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :ivar type: The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' + includes both an implicitly created identity and a set of user assigned identities. The type + 'None' will remove any identities from the service. Known values are: "SystemAssigned", + "UserAssigned", "SystemAssigned,UserAssigned", and "None". + :vartype type: str or ~azure.mgmt.cosmosdb.models.ResourceIdentityType + :ivar user_assigned_identities: The list of user identities associated with resource. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. # pylint: disable=line-too-long + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.cosmosdb.models.ManagedServiceIdentityUserAssignedIdentity] """ _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, } _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "resource": {"key": "properties.resource", "type": "MongoDBDatabaseGetPropertiesResource"}, - "options": {"key": "properties.options", "type": "MongoDBDatabaseGetPropertiesOptions"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{ManagedServiceIdentityUserAssignedIdentity}", + }, } def __init__( self, *, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - resource: Optional["_models.MongoDBDatabaseGetPropertiesResource"] = None, - options: Optional["_models.MongoDBDatabaseGetPropertiesOptions"] = None, + type: Optional[Union[str, "_models.ResourceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "_models.ManagedServiceIdentityUserAssignedIdentity"]] = None, **kwargs: Any ) -> None: """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :keyword resource: - :paramtype resource: ~azure.mgmt.cosmosdb.models.MongoDBDatabaseGetPropertiesResource - :keyword options: - :paramtype options: ~azure.mgmt.cosmosdb.models.MongoDBDatabaseGetPropertiesOptions + :keyword type: The type of identity used for the resource. The type + 'SystemAssigned,UserAssigned' includes both an implicitly created identity and a set of user + assigned identities. The type 'None' will remove any identities from the service. Known values + are: "SystemAssigned", "UserAssigned", "SystemAssigned,UserAssigned", and "None". + :paramtype type: str or ~azure.mgmt.cosmosdb.models.ResourceIdentityType + :keyword user_assigned_identities: The list of user identities associated with resource. The + user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. # pylint: disable=line-too-long + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.cosmosdb.models.ManagedServiceIdentityUserAssignedIdentity] """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.resource = resource - self.options = options + super().__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.user_assigned_identities = user_assigned_identities -class MongoDBDatabaseListResult(_serialization.Model): - """The List operation response, that contains the MongoDB databases and their properties. +class ManagedServiceIdentityUserAssignedIdentity(_serialization.Model): # pylint: disable=name-too-long + """ManagedServiceIdentityUserAssignedIdentity. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of MongoDB databases and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.MongoDBDatabaseGetResults] + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str """ _validation = { - "value": {"readonly": True}, + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, } _attribute_map = { - "value": {"key": "value", "type": "[MongoDBDatabaseGetResults]"}, + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None - + self.principal_id = None + self.client_id = None -class MongoIndex(_serialization.Model): - """Cosmos DB MongoDB collection index key. - :ivar key: Cosmos DB MongoDB collection index keys. - :vartype key: ~azure.mgmt.cosmosdb.models.MongoIndexKeys - :ivar options: Cosmos DB MongoDB collection index key options. - :vartype options: ~azure.mgmt.cosmosdb.models.MongoIndexOptions - """ +class MaterializedViewsBuilderRegionalServiceResource(RegionalServiceResource): # pylint: disable=name-too-long + """Resource for a regional service location. - _attribute_map = { - "key": {"key": "key", "type": "MongoIndexKeys"}, - "options": {"key": "options", "type": "MongoIndexOptions"}, - } + Variables are only populated by the server, and will be ignored when sending a request. - def __init__( - self, - *, - key: Optional["_models.MongoIndexKeys"] = None, - options: Optional["_models.MongoIndexOptions"] = None, - **kwargs: Any - ) -> None: - """ - :keyword key: Cosmos DB MongoDB collection index keys. - :paramtype key: ~azure.mgmt.cosmosdb.models.MongoIndexKeys - :keyword options: Cosmos DB MongoDB collection index key options. - :paramtype options: ~azure.mgmt.cosmosdb.models.MongoIndexOptions - """ - super().__init__(**kwargs) - self.key = key - self.options = options + :ivar name: The regional service name. + :vartype name: str + :ivar location: The location name. + :vartype location: str + :ivar status: Describes the status of a service. Known values are: "Creating", "Running", + "Updating", "Deleting", "Error", and "Stopped". + :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus + """ -class MongoIndexKeys(_serialization.Model): - """Cosmos DB MongoDB collection resource object. +class MaterializedViewsBuilderServiceResource(_serialization.Model): + """Describes the service response property for MaterializedViewsBuilder. - :ivar keys: List of keys for each MongoDB collection in the Azure Cosmos DB service. - :vartype keys: list[str] + :ivar properties: Properties for MaterializedViewsBuilderServiceResource. + :vartype properties: + ~azure.mgmt.cosmosdb.models.MaterializedViewsBuilderServiceResourceProperties """ _attribute_map = { - "keys": {"key": "keys", "type": "[str]"}, + "properties": {"key": "properties", "type": "MaterializedViewsBuilderServiceResourceProperties"}, } - def __init__(self, *, keys: Optional[List[str]] = None, **kwargs: Any) -> None: + def __init__( + self, *, properties: Optional["_models.MaterializedViewsBuilderServiceResourceProperties"] = None, **kwargs: Any + ) -> None: """ - :keyword keys: List of keys for each MongoDB collection in the Azure Cosmos DB service. - :paramtype keys: list[str] + :keyword properties: Properties for MaterializedViewsBuilderServiceResource. + :paramtype properties: + ~azure.mgmt.cosmosdb.models.MaterializedViewsBuilderServiceResourceProperties """ super().__init__(**kwargs) - self.keys = keys + self.properties = properties -class MongoIndexOptions(_serialization.Model): - """Cosmos DB MongoDB collection index options. +class MaterializedViewsBuilderServiceResourceCreateUpdateProperties( + ServiceResourceCreateUpdateProperties +): # pylint: disable=name-too-long + """Properties for Create or Update request for MaterializedViewsBuilderServiceResource. + + All required parameters must be populated in order to send to server. - :ivar expire_after_seconds: Expire after seconds. - :vartype expire_after_seconds: int - :ivar unique: Is unique or not. - :vartype unique: bool + :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", + "Cosmos.D8s", and "Cosmos.D16s". + :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :ivar instance_count: Instance count for the service. + :vartype instance_count: int + :ivar service_type: ServiceType for the service. Required. Known values are: + "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". + :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType """ + _validation = { + "instance_count": {"minimum": 0}, + "service_type": {"required": True}, + } + _attribute_map = { - "expire_after_seconds": {"key": "expireAfterSeconds", "type": "int"}, - "unique": {"key": "unique", "type": "bool"}, + "instance_size": {"key": "instanceSize", "type": "str"}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "service_type": {"key": "serviceType", "type": "str"}, } def __init__( - self, *, expire_after_seconds: Optional[int] = None, unique: Optional[bool] = None, **kwargs: Any + self, + *, + instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, + instance_count: Optional[int] = None, + **kwargs: Any ) -> None: """ - :keyword expire_after_seconds: Expire after seconds. - :paramtype expire_after_seconds: int - :keyword unique: Is unique or not. - :paramtype unique: bool + :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", + "Cosmos.D8s", and "Cosmos.D16s". + :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :keyword instance_count: Instance count for the service. + :paramtype instance_count: int """ - super().__init__(**kwargs) - self.expire_after_seconds = expire_after_seconds - self.unique = unique + super().__init__(instance_size=instance_size, instance_count=instance_count, **kwargs) + self.service_type: str = "MaterializedViewsBuilder" -class MongoRoleDefinitionCreateUpdateParameters(_serialization.Model): # pylint: disable=name-too-long - """Parameters to create and update an Azure Cosmos DB Mongo Role Definition. +class MaterializedViewsBuilderServiceResourceProperties(ServiceResourceProperties): # pylint: disable=name-too-long + """Properties for MaterializedViewsBuilderServiceResource. - :ivar role_name: A user-friendly name for the Role Definition. Must be unique for the database - account. - :vartype role_name: str - :ivar type: Indicates whether the Role Definition was built-in or user created. Known values - are: "BuiltInRole" and "CustomRole". - :vartype type: str or ~azure.mgmt.cosmosdb.models.MongoRoleDefinitionType - :ivar database_name: The database name for which access is being granted for this Role - Definition. - :vartype database_name: str - :ivar privileges: A set of privileges contained by the Role Definition. This will allow - application of this Role Definition on the entire database account or any underlying Database / - Collection. Scopes higher than Database are not enforceable as privilege. - :vartype privileges: list[~azure.mgmt.cosmosdb.models.Privilege] - :ivar roles: The set of roles inherited by this Role Definition. - :vartype roles: list[~azure.mgmt.cosmosdb.models.Role] + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar additional_properties: Unmatched properties from the message are deserialized to this + collection. + :vartype additional_properties: dict[str, any] + :ivar creation_time: Time of the last state change (ISO-8601 format). + :vartype creation_time: ~datetime.datetime + :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", + "Cosmos.D8s", and "Cosmos.D16s". + :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :ivar instance_count: Instance count for the service. + :vartype instance_count: int + :ivar service_type: ServiceType for the service. Required. Known values are: + "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". + :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType + :ivar status: Describes the status of a service. Known values are: "Creating", "Running", + "Updating", "Deleting", "Error", and "Stopped". + :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus + :ivar locations: An array that contains all of the locations for the service. + :vartype locations: + list[~azure.mgmt.cosmosdb.models.MaterializedViewsBuilderRegionalServiceResource] """ + _validation = { + "creation_time": {"readonly": True}, + "instance_count": {"minimum": 0}, + "service_type": {"required": True}, + "status": {"readonly": True}, + "locations": {"readonly": True}, + } + _attribute_map = { - "role_name": {"key": "properties.roleName", "type": "str"}, - "type": {"key": "properties.type", "type": "str"}, - "database_name": {"key": "properties.databaseName", "type": "str"}, - "privileges": {"key": "properties.privileges", "type": "[Privilege]"}, - "roles": {"key": "properties.roles", "type": "[Role]"}, + "additional_properties": {"key": "", "type": "{object}"}, + "creation_time": {"key": "creationTime", "type": "iso-8601"}, + "instance_size": {"key": "instanceSize", "type": "str"}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "service_type": {"key": "serviceType", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "locations": {"key": "locations", "type": "[MaterializedViewsBuilderRegionalServiceResource]"}, } def __init__( self, *, - role_name: Optional[str] = None, - type: Optional[Union[str, "_models.MongoRoleDefinitionType"]] = None, - database_name: Optional[str] = None, - privileges: Optional[List["_models.Privilege"]] = None, - roles: Optional[List["_models.Role"]] = None, + additional_properties: Optional[Dict[str, Any]] = None, + instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, + instance_count: Optional[int] = None, **kwargs: Any ) -> None: """ - :keyword role_name: A user-friendly name for the Role Definition. Must be unique for the - database account. - :paramtype role_name: str - :keyword type: Indicates whether the Role Definition was built-in or user created. Known values - are: "BuiltInRole" and "CustomRole". - :paramtype type: str or ~azure.mgmt.cosmosdb.models.MongoRoleDefinitionType - :keyword database_name: The database name for which access is being granted for this Role - Definition. - :paramtype database_name: str - :keyword privileges: A set of privileges contained by the Role Definition. This will allow - application of this Role Definition on the entire database account or any underlying Database / - Collection. Scopes higher than Database are not enforceable as privilege. - :paramtype privileges: list[~azure.mgmt.cosmosdb.models.Privilege] - :keyword roles: The set of roles inherited by this Role Definition. - :paramtype roles: list[~azure.mgmt.cosmosdb.models.Role] + :keyword additional_properties: Unmatched properties from the message are deserialized to this + collection. + :paramtype additional_properties: dict[str, any] + :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", + "Cosmos.D8s", and "Cosmos.D16s". + :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :keyword instance_count: Instance count for the service. + :paramtype instance_count: int """ - super().__init__(**kwargs) - self.role_name = role_name - self.type = type - self.database_name = database_name - self.privileges = privileges - self.roles = roles + super().__init__( + additional_properties=additional_properties, + instance_size=instance_size, + instance_count=instance_count, + **kwargs + ) + self.service_type: str = "MaterializedViewsBuilder" + self.locations = None -class MongoRoleDefinitionGetResults(ARMProxyResource): - """An Azure Cosmos DB Mongo Role Definition. +class Metric(_serialization.Model): + """Metric data. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The unique resource identifier of the database account. - :vartype id: str - :ivar name: The name of the database account. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar role_name: A user-friendly name for the Role Definition. Must be unique for the database - account. - :vartype role_name: str - :ivar type_properties_type: Indicates whether the Role Definition was built-in or user created. - Known values are: "BuiltInRole" and "CustomRole". - :vartype type_properties_type: str or ~azure.mgmt.cosmosdb.models.MongoRoleDefinitionType - :ivar database_name: The database name for which access is being granted for this Role - Definition. - :vartype database_name: str - :ivar privileges: A set of privileges contained by the Role Definition. This will allow - application of this Role Definition on the entire database account or any underlying Database / - Collection. Scopes higher than Database are not enforceable as privilege. - :vartype privileges: list[~azure.mgmt.cosmosdb.models.Privilege] - :ivar roles: The set of roles inherited by this Role Definition. - :vartype roles: list[~azure.mgmt.cosmosdb.models.Role] + :ivar start_time: The start time for the metric (ISO-8601 format). + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time for the metric (ISO-8601 format). + :vartype end_time: ~datetime.datetime + :ivar time_grain: The time grain to be used to summarize the metric values. + :vartype time_grain: str + :ivar unit: The unit of the metric. Known values are: "Count", "Bytes", "Seconds", "Percent", + "CountPerSecond", "BytesPerSecond", and "Milliseconds". + :vartype unit: str or ~azure.mgmt.cosmosdb.models.UnitType + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cosmosdb.models.MetricName + :ivar metric_values: The metric values for the specified time window and timestep. + :vartype metric_values: list[~azure.mgmt.cosmosdb.models.MetricValue] """ _validation = { - "id": {"readonly": True}, + "start_time": {"readonly": True}, + "end_time": {"readonly": True}, + "time_grain": {"readonly": True}, + "unit": {"readonly": True}, "name": {"readonly": True}, - "type": {"readonly": True}, + "metric_values": {"readonly": True}, } _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "role_name": {"key": "properties.roleName", "type": "str"}, - "type_properties_type": {"key": "properties.type", "type": "str"}, - "database_name": {"key": "properties.databaseName", "type": "str"}, - "privileges": {"key": "properties.privileges", "type": "[Privilege]"}, - "roles": {"key": "properties.roles", "type": "[Role]"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "time_grain": {"key": "timeGrain", "type": "str"}, + "unit": {"key": "unit", "type": "str"}, + "name": {"key": "name", "type": "MetricName"}, + "metric_values": {"key": "metricValues", "type": "[MetricValue]"}, } - def __init__( - self, - *, - role_name: Optional[str] = None, - type_properties_type: Optional[Union[str, "_models.MongoRoleDefinitionType"]] = None, - database_name: Optional[str] = None, - privileges: Optional[List["_models.Privilege"]] = None, - roles: Optional[List["_models.Role"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword role_name: A user-friendly name for the Role Definition. Must be unique for the - database account. - :paramtype role_name: str - :keyword type_properties_type: Indicates whether the Role Definition was built-in or user - created. Known values are: "BuiltInRole" and "CustomRole". - :paramtype type_properties_type: str or ~azure.mgmt.cosmosdb.models.MongoRoleDefinitionType - :keyword database_name: The database name for which access is being granted for this Role - Definition. - :paramtype database_name: str - :keyword privileges: A set of privileges contained by the Role Definition. This will allow - application of this Role Definition on the entire database account or any underlying Database / - Collection. Scopes higher than Database are not enforceable as privilege. - :paramtype privileges: list[~azure.mgmt.cosmosdb.models.Privilege] - :keyword roles: The set of roles inherited by this Role Definition. - :paramtype roles: list[~azure.mgmt.cosmosdb.models.Role] - """ + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.start_time = None + self.end_time = None + self.time_grain = None + self.unit = None + self.name = None + self.metric_values = None + + +class MetricAvailability(_serialization.Model): + """The availability of the metric. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar time_grain: The time grain to be used to summarize the metric values. + :vartype time_grain: str + :ivar retention: The retention for the metric values. + :vartype retention: str + """ + + _validation = { + "time_grain": {"readonly": True}, + "retention": {"readonly": True}, + } + + _attribute_map = { + "time_grain": {"key": "timeGrain", "type": "str"}, + "retention": {"key": "retention", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.role_name = role_name - self.type_properties_type = type_properties_type - self.database_name = database_name - self.privileges = privileges - self.roles = roles + self.time_grain = None + self.retention = None -class MongoRoleDefinitionListResult(_serialization.Model): - """The relevant Mongo Role Definitions. +class MetricDefinition(_serialization.Model): + """The definition of a metric. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of Mongo Role Definitions and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.MongoRoleDefinitionGetResults] + :ivar metric_availabilities: The list of metric availabilities for the account. + :vartype metric_availabilities: list[~azure.mgmt.cosmosdb.models.MetricAvailability] + :ivar primary_aggregation_type: The primary aggregation type of the metric. Known values are: + "None", "Average", "Total", "Minimum", "Maximum", and "Last". + :vartype primary_aggregation_type: str or ~azure.mgmt.cosmosdb.models.PrimaryAggregationType + :ivar unit: The unit of the metric. Known values are: "Count", "Bytes", "Seconds", "Percent", + "CountPerSecond", "BytesPerSecond", and "Milliseconds". + :vartype unit: str or ~azure.mgmt.cosmosdb.models.UnitType + :ivar resource_uri: The resource uri of the database. + :vartype resource_uri: str + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cosmosdb.models.MetricName """ _validation = { - "value": {"readonly": True}, + "metric_availabilities": {"readonly": True}, + "primary_aggregation_type": {"readonly": True}, + "unit": {"readonly": True}, + "resource_uri": {"readonly": True}, + "name": {"readonly": True}, } _attribute_map = { - "value": {"key": "value", "type": "[MongoRoleDefinitionGetResults]"}, + "metric_availabilities": {"key": "metricAvailabilities", "type": "[MetricAvailability]"}, + "primary_aggregation_type": {"key": "primaryAggregationType", "type": "str"}, + "unit": {"key": "unit", "type": "str"}, + "resource_uri": {"key": "resourceUri", "type": "str"}, + "name": {"key": "name", "type": "MetricName"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None + self.metric_availabilities = None + self.primary_aggregation_type = None + self.unit = None + self.resource_uri = None + self.name = None -class MongoUserDefinitionCreateUpdateParameters(_serialization.Model): # pylint: disable=name-too-long - """Parameters to create and update an Azure Cosmos DB Mongo User Definition. +class MetricDefinitionsListResult(_serialization.Model): + """The response to a list metric definitions request. - :ivar user_name: The user name for User Definition. - :vartype user_name: str - :ivar password: The password for User Definition. Response does not contain user password. - :vartype password: str - :ivar database_name: The database name for which access is being granted for this User - Definition. - :vartype database_name: str - :ivar custom_data: A custom definition for the USer Definition. - :vartype custom_data: str - :ivar roles: The set of roles inherited by the User Definition. - :vartype roles: list[~azure.mgmt.cosmosdb.models.Role] - :ivar mechanisms: The Mongo Auth mechanism. For now, we only support auth mechanism - SCRAM-SHA-256. - :vartype mechanisms: str + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of metric definitions for the account. + :vartype value: list[~azure.mgmt.cosmosdb.models.MetricDefinition] """ + _validation = { + "value": {"readonly": True}, + } + _attribute_map = { - "user_name": {"key": "properties.userName", "type": "str"}, - "password": {"key": "properties.password", "type": "str"}, - "database_name": {"key": "properties.databaseName", "type": "str"}, - "custom_data": {"key": "properties.customData", "type": "str"}, - "roles": {"key": "properties.roles", "type": "[Role]"}, - "mechanisms": {"key": "properties.mechanisms", "type": "str"}, + "value": {"key": "value", "type": "[MetricDefinition]"}, } - def __init__( - self, - *, - user_name: Optional[str] = None, - password: Optional[str] = None, - database_name: Optional[str] = None, - custom_data: Optional[str] = None, - roles: Optional[List["_models.Role"]] = None, - mechanisms: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword user_name: The user name for User Definition. - :paramtype user_name: str - :keyword password: The password for User Definition. Response does not contain user password. - :paramtype password: str - :keyword database_name: The database name for which access is being granted for this User - Definition. - :paramtype database_name: str - :keyword custom_data: A custom definition for the USer Definition. - :paramtype custom_data: str - :keyword roles: The set of roles inherited by the User Definition. - :paramtype roles: list[~azure.mgmt.cosmosdb.models.Role] - :keyword mechanisms: The Mongo Auth mechanism. For now, we only support auth mechanism - SCRAM-SHA-256. - :paramtype mechanisms: str - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.user_name = user_name - self.password = password - self.database_name = database_name - self.custom_data = custom_data - self.roles = roles - self.mechanisms = mechanisms + self.value = None -class MongoUserDefinitionGetResults(ARMProxyResource): - """An Azure Cosmos DB User Definition. +class MetricListResult(_serialization.Model): + """The response to a list metrics request. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The unique resource identifier of the database account. - :vartype id: str - :ivar name: The name of the database account. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar user_name: The user name for User Definition. - :vartype user_name: str - :ivar password: The password for User Definition. Response does not contain user password. - :vartype password: str - :ivar database_name: The database name for which access is being granted for this User - Definition. - :vartype database_name: str - :ivar custom_data: A custom definition for the USer Definition. - :vartype custom_data: str - :ivar roles: The set of roles inherited by the User Definition. - :vartype roles: list[~azure.mgmt.cosmosdb.models.Role] - :ivar mechanisms: The Mongo Auth mechanism. For now, we only support auth mechanism - SCRAM-SHA-256. - :vartype mechanisms: str + :ivar value: The list of metrics for the account. + :vartype value: list[~azure.mgmt.cosmosdb.models.Metric] """ _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, + "value": {"readonly": True}, } _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "user_name": {"key": "properties.userName", "type": "str"}, - "password": {"key": "properties.password", "type": "str"}, - "database_name": {"key": "properties.databaseName", "type": "str"}, - "custom_data": {"key": "properties.customData", "type": "str"}, - "roles": {"key": "properties.roles", "type": "[Role]"}, - "mechanisms": {"key": "properties.mechanisms", "type": "str"}, + "value": {"key": "value", "type": "[Metric]"}, } - def __init__( - self, - *, - user_name: Optional[str] = None, - password: Optional[str] = None, - database_name: Optional[str] = None, - custom_data: Optional[str] = None, - roles: Optional[List["_models.Role"]] = None, - mechanisms: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword user_name: The user name for User Definition. - :paramtype user_name: str - :keyword password: The password for User Definition. Response does not contain user password. - :paramtype password: str - :keyword database_name: The database name for which access is being granted for this User - Definition. - :paramtype database_name: str - :keyword custom_data: A custom definition for the USer Definition. - :paramtype custom_data: str - :keyword roles: The set of roles inherited by the User Definition. - :paramtype roles: list[~azure.mgmt.cosmosdb.models.Role] - :keyword mechanisms: The Mongo Auth mechanism. For now, we only support auth mechanism - SCRAM-SHA-256. - :paramtype mechanisms: str - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.user_name = user_name - self.password = password - self.database_name = database_name - self.custom_data = custom_data - self.roles = roles - self.mechanisms = mechanisms + self.value = None -class MongoUserDefinitionListResult(_serialization.Model): - """The relevant User Definition. +class MetricName(_serialization.Model): + """A metric name. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of User Definition and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.MongoUserDefinitionGetResults] + :ivar value: The name of the metric. + :vartype value: str + :ivar localized_value: The friendly name of the metric. + :vartype localized_value: str """ _validation = { "value": {"readonly": True}, + "localized_value": {"readonly": True}, } _attribute_map = { - "value": {"key": "value", "type": "[MongoUserDefinitionGetResults]"}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None + self.localized_value = None -class NetworkSecurityPerimeter(_serialization.Model): - """Information about a network security perimeter (NSP). +class MetricValue(_serialization.Model): + """Represents metrics values. - :ivar id: Fully qualified Azure resource ID of the NSP resource. - :vartype id: str - :ivar perimeter_guid: Universal unique ID (UUID) of the network security perimeter. - :vartype perimeter_guid: str - :ivar location: Location of the network security perimeter. - :vartype location: str + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar count: The number of values for the metric. + :vartype count: int + :ivar average: The average value of the metric. + :vartype average: float + :ivar maximum: The max value of the metric. + :vartype maximum: float + :ivar minimum: The min value of the metric. + :vartype minimum: float + :ivar timestamp: The metric timestamp (ISO-8601 format). + :vartype timestamp: ~datetime.datetime + :ivar total: The total value of the metric. + :vartype total: float """ - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "perimeter_guid": {"key": "perimeterGuid", "type": "str"}, - "location": {"key": "location", "type": "str"}, + _validation = { + "count": {"readonly": True}, + "average": {"readonly": True}, + "maximum": {"readonly": True}, + "minimum": {"readonly": True}, + "timestamp": {"readonly": True}, + "total": {"readonly": True}, } - def __init__( - self, - *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - perimeter_guid: Optional[str] = None, - location: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword id: Fully qualified Azure resource ID of the NSP resource. - :paramtype id: str - :keyword perimeter_guid: Universal unique ID (UUID) of the network security perimeter. - :paramtype perimeter_guid: str - :keyword location: Location of the network security perimeter. - :paramtype location: str - """ + _attribute_map = { + "count": {"key": "_count", "type": "int"}, + "average": {"key": "average", "type": "float"}, + "maximum": {"key": "maximum", "type": "float"}, + "minimum": {"key": "minimum", "type": "float"}, + "timestamp": {"key": "timestamp", "type": "iso-8601"}, + "total": {"key": "total", "type": "float"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.id = id - self.perimeter_guid = perimeter_guid - self.location = location + self.count = None + self.average = None + self.maximum = None + self.minimum = None + self.timestamp = None + self.total = None -class NetworkSecurityPerimeterConfiguration(ProxyResource): - """Network security perimeter (NSP) configuration resource. +class MongoDBCollectionCreateUpdateParameters(ARMResourceProperties): + """Parameters to create and update Cosmos DB MongoDB collection. 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 + All required parameters must be populated in order to send to server. + + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str - :ivar name: The name of the resource. + :ivar name: The name of the ARM resource. :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". + :ivar type: The type of Azure resource. :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cosmosdb.models.SystemData - :ivar properties: Network security configuration properties. - :vartype properties: - ~azure.mgmt.cosmosdb.models.NetworkSecurityPerimeterConfigurationProperties + :ivar location: The location of the resource group to which the resource belongs. + :vartype location: str + :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :vartype tags: dict[str, str] + :ivar resource: The standard JSON format of a MongoDB collection. Required. + :vartype resource: ~azure.mgmt.cosmosdb.models.MongoDBCollectionResource + :ivar options: A key-value pair of options to be applied for the request. This corresponds to + the headers sent with the request. + :vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, - "system_data": {"readonly": True}, + "resource": {"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"}, - "properties": {"key": "properties", "type": "NetworkSecurityPerimeterConfigurationProperties"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "resource": {"key": "properties.resource", "type": "MongoDBCollectionResource"}, + "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, } def __init__( - self, *, properties: Optional["_models.NetworkSecurityPerimeterConfigurationProperties"] = None, **kwargs: Any + self, + *, + resource: "_models.MongoDBCollectionResource", + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + options: Optional["_models.CreateUpdateOptions"] = None, + **kwargs: Any ) -> None: """ - :keyword properties: Network security configuration properties. - :paramtype properties: - ~azure.mgmt.cosmosdb.models.NetworkSecurityPerimeterConfigurationProperties + :keyword location: The location of the resource group to which the resource belongs. + :paramtype location: str + :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :paramtype tags: dict[str, str] + :keyword resource: The standard JSON format of a MongoDB collection. Required. + :paramtype resource: ~azure.mgmt.cosmosdb.models.MongoDBCollectionResource + :keyword options: A key-value pair of options to be applied for the request. This corresponds + to the headers sent with the request. + :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ - super().__init__(**kwargs) - self.properties = properties + super().__init__(location=location, tags=tags, **kwargs) + self.resource = resource + self.options = options -class NetworkSecurityPerimeterConfigurationListResult(_serialization.Model): # pylint: disable=name-too-long - """Result of a list NSP (network security perimeter) configurations request. +class MongoDBCollectionGetPropertiesOptions(OptionsResource): + """MongoDBCollectionGetPropertiesOptions. - :ivar value: Array of network security perimeter results. - :vartype value: list[~azure.mgmt.cosmosdb.models.NetworkSecurityPerimeterConfiguration] - :ivar next_link: The link used to get the next page of results. - :vartype next_link: str + :ivar throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the + ThroughputSetting resource when retrieving offer details. + :vartype throughput: int + :ivar autoscale_settings: Specifies the Autoscale settings. + :vartype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings """ - _attribute_map = { - "value": {"key": "value", "type": "[NetworkSecurityPerimeterConfiguration]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, - *, - value: Optional[List["_models.NetworkSecurityPerimeterConfiguration"]] = None, - next_link: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword value: Array of network security perimeter results. - :paramtype value: list[~azure.mgmt.cosmosdb.models.NetworkSecurityPerimeterConfiguration] - :keyword next_link: The link used to get the next page of results. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - -class NetworkSecurityPerimeterConfigurationProperties(_serialization.Model): # pylint: disable=name-too-long - """Network security configuration properties. +class MongoDBCollectionResource(_serialization.Model): + """Cosmos DB MongoDB collection resource object. - 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 provisioning_state: Provisioning state of a network security perimeter configuration that - is being created or updated. Known values are: "Succeeded", "Creating", "Updating", "Deleting", - "Accepted", "Failed", and "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.cosmosdb.models.NetworkSecurityPerimeterConfigurationProvisioningState - :ivar provisioning_issues: List of provisioning issues, if any. - :vartype provisioning_issues: list[~azure.mgmt.cosmosdb.models.ProvisioningIssue] - :ivar network_security_perimeter: Information about a network security perimeter (NSP). - :vartype network_security_perimeter: ~azure.mgmt.cosmosdb.models.NetworkSecurityPerimeter - :ivar resource_association: Information about resource association. - :vartype resource_association: ~azure.mgmt.cosmosdb.models.ResourceAssociation - :ivar profile: Network security perimeter configuration profile. - :vartype profile: ~azure.mgmt.cosmosdb.models.NetworkSecurityProfile + :ivar id: Name of the Cosmos DB MongoDB collection. Required. + :vartype id: str + :ivar shard_key: A key-value pair of shard keys to be applied for the request. + :vartype shard_key: dict[str, str] + :ivar indexes: List of index keys. + :vartype indexes: list[~azure.mgmt.cosmosdb.models.MongoIndex] + :ivar analytical_storage_ttl: Analytical TTL. + :vartype analytical_storage_ttl: int + :ivar restore_parameters: Parameters to indicate the information about the restore. + :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" + and "Restore". + :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode """ _validation = { - "provisioning_state": {"readonly": True}, - "provisioning_issues": {"readonly": True}, + "id": {"required": True}, } _attribute_map = { - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "provisioning_issues": {"key": "provisioningIssues", "type": "[ProvisioningIssue]"}, - "network_security_perimeter": {"key": "networkSecurityPerimeter", "type": "NetworkSecurityPerimeter"}, - "resource_association": {"key": "resourceAssociation", "type": "ResourceAssociation"}, - "profile": {"key": "profile", "type": "NetworkSecurityProfile"}, + "id": {"key": "id", "type": "str"}, + "shard_key": {"key": "shardKey", "type": "{str}"}, + "indexes": {"key": "indexes", "type": "[MongoIndex]"}, + "analytical_storage_ttl": {"key": "analyticalStorageTtl", "type": "int"}, + "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, + "create_mode": {"key": "createMode", "type": "str"}, } def __init__( self, *, - network_security_perimeter: Optional["_models.NetworkSecurityPerimeter"] = None, - resource_association: Optional["_models.ResourceAssociation"] = None, - profile: Optional["_models.NetworkSecurityProfile"] = None, + id: str, # pylint: disable=redefined-builtin + shard_key: Optional[Dict[str, str]] = None, + indexes: Optional[List["_models.MongoIndex"]] = None, + analytical_storage_ttl: Optional[int] = None, + restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, + create_mode: Union[str, "_models.CreateMode"] = "Default", **kwargs: Any ) -> None: """ - :keyword network_security_perimeter: Information about a network security perimeter (NSP). - :paramtype network_security_perimeter: ~azure.mgmt.cosmosdb.models.NetworkSecurityPerimeter - :keyword resource_association: Information about resource association. - :paramtype resource_association: ~azure.mgmt.cosmosdb.models.ResourceAssociation - :keyword profile: Network security perimeter configuration profile. - :paramtype profile: ~azure.mgmt.cosmosdb.models.NetworkSecurityProfile + :keyword id: Name of the Cosmos DB MongoDB collection. Required. + :paramtype id: str + :keyword shard_key: A key-value pair of shard keys to be applied for the request. + :paramtype shard_key: dict[str, str] + :keyword indexes: List of index keys. + :paramtype indexes: list[~azure.mgmt.cosmosdb.models.MongoIndex] + :keyword analytical_storage_ttl: Analytical TTL. + :paramtype analytical_storage_ttl: int + :keyword restore_parameters: Parameters to indicate the information about the restore. + :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: + "Default" and "Restore". + :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode """ super().__init__(**kwargs) - self.provisioning_state = None - self.provisioning_issues = None - self.network_security_perimeter = network_security_perimeter - self.resource_association = resource_association - self.profile = profile + self.id = id + self.shard_key = shard_key + self.indexes = indexes + self.analytical_storage_ttl = analytical_storage_ttl + self.restore_parameters = restore_parameters + self.create_mode = create_mode + +class MongoDBCollectionGetPropertiesResource(MongoDBCollectionResource, ExtendedResourceProperties): + """MongoDBCollectionGetPropertiesResource. -class NetworkSecurityProfile(_serialization.Model): - """Network security perimeter configuration profile. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: Name of the profile. - :vartype name: str - :ivar access_rules_version: Current access rules version. - :vartype access_rules_version: int - :ivar access_rules: List of Access Rules. - :vartype access_rules: list[~azure.mgmt.cosmosdb.models.AccessRule] - :ivar diagnostic_settings_version: Current diagnostic settings version. - :vartype diagnostic_settings_version: int - :ivar enabled_log_categories: List of log categories that are enabled. - :vartype enabled_log_categories: list[str] + All required parameters must be populated in order to send to server. + + :ivar rid: A system generated property. A unique identifier. + :vartype rid: str + :ivar ts: A system generated property that denotes the last updated timestamp of the resource. + :vartype ts: float + :ivar etag: A system generated property representing the resource etag required for optimistic + concurrency control. + :vartype etag: str + :ivar id: Name of the Cosmos DB MongoDB collection. Required. + :vartype id: str + :ivar shard_key: A key-value pair of shard keys to be applied for the request. + :vartype shard_key: dict[str, str] + :ivar indexes: List of index keys. + :vartype indexes: list[~azure.mgmt.cosmosdb.models.MongoIndex] + :ivar analytical_storage_ttl: Analytical TTL. + :vartype analytical_storage_ttl: int + :ivar restore_parameters: Parameters to indicate the information about the restore. + :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" + and "Restore". + :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode """ + _validation = { + "rid": {"readonly": True}, + "ts": {"readonly": True}, + "etag": {"readonly": True}, + "id": {"required": True}, + } + _attribute_map = { - "name": {"key": "name", "type": "str"}, - "access_rules_version": {"key": "accessRulesVersion", "type": "int"}, - "access_rules": {"key": "accessRules", "type": "[AccessRule]"}, - "diagnostic_settings_version": {"key": "diagnosticSettingsVersion", "type": "int"}, - "enabled_log_categories": {"key": "enabledLogCategories", "type": "[str]"}, + "rid": {"key": "_rid", "type": "str"}, + "ts": {"key": "_ts", "type": "float"}, + "etag": {"key": "_etag", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "shard_key": {"key": "shardKey", "type": "{str}"}, + "indexes": {"key": "indexes", "type": "[MongoIndex]"}, + "analytical_storage_ttl": {"key": "analyticalStorageTtl", "type": "int"}, + "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, + "create_mode": {"key": "createMode", "type": "str"}, } def __init__( self, *, - name: Optional[str] = None, - access_rules_version: Optional[int] = None, - access_rules: Optional[List["_models.AccessRule"]] = None, - diagnostic_settings_version: Optional[int] = None, - enabled_log_categories: Optional[List[str]] = None, + id: str, # pylint: disable=redefined-builtin + shard_key: Optional[Dict[str, str]] = None, + indexes: Optional[List["_models.MongoIndex"]] = None, + analytical_storage_ttl: Optional[int] = None, + restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, + create_mode: Union[str, "_models.CreateMode"] = "Default", **kwargs: Any ) -> None: """ - :keyword name: Name of the profile. - :paramtype name: str - :keyword access_rules_version: Current access rules version. - :paramtype access_rules_version: int - :keyword access_rules: List of Access Rules. - :paramtype access_rules: list[~azure.mgmt.cosmosdb.models.AccessRule] - :keyword diagnostic_settings_version: Current diagnostic settings version. - :paramtype diagnostic_settings_version: int - :keyword enabled_log_categories: List of log categories that are enabled. - :paramtype enabled_log_categories: list[str] + :keyword id: Name of the Cosmos DB MongoDB collection. Required. + :paramtype id: str + :keyword shard_key: A key-value pair of shard keys to be applied for the request. + :paramtype shard_key: dict[str, str] + :keyword indexes: List of index keys. + :paramtype indexes: list[~azure.mgmt.cosmosdb.models.MongoIndex] + :keyword analytical_storage_ttl: Analytical TTL. + :paramtype analytical_storage_ttl: int + :keyword restore_parameters: Parameters to indicate the information about the restore. + :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: + "Default" and "Restore". + :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode """ - super().__init__(**kwargs) - self.name = name - self.access_rules_version = access_rules_version - self.access_rules = access_rules - self.diagnostic_settings_version = diagnostic_settings_version - self.enabled_log_categories = enabled_log_categories + super().__init__( + id=id, + shard_key=shard_key, + indexes=indexes, + analytical_storage_ttl=analytical_storage_ttl, + restore_parameters=restore_parameters, + create_mode=create_mode, + **kwargs + ) + self.rid = None + self.ts = None + self.etag = None + self.id = id + self.shard_key = shard_key + self.indexes = indexes + self.analytical_storage_ttl = analytical_storage_ttl + self.restore_parameters = restore_parameters + self.create_mode = create_mode -class NotebookWorkspace(ARMProxyResource): - """A notebook workspace resource. +class MongoDBCollectionGetResults(ARMResourceProperties): + """An Azure Cosmos DB MongoDB collection. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The unique resource identifier of the database account. + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str - :ivar name: The name of the database account. + :ivar name: The name of the ARM resource. :vartype name: str :ivar type: The type of Azure resource. :vartype type: str - :ivar notebook_server_endpoint: Specifies the endpoint of Notebook server. - :vartype notebook_server_endpoint: str - :ivar status: Status of the notebook workspace. Possible values are: Creating, Online, - Deleting, Failed, Updating. - :vartype status: str + :ivar location: The location of the resource group to which the resource belongs. + :vartype location: str + :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :vartype tags: dict[str, str] + :ivar resource: + :vartype resource: ~azure.mgmt.cosmosdb.models.MongoDBCollectionGetPropertiesResource + :ivar options: + :vartype options: ~azure.mgmt.cosmosdb.models.MongoDBCollectionGetPropertiesOptions """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, - "notebook_server_endpoint": {"readonly": True}, - "status": {"readonly": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "notebook_server_endpoint": {"key": "properties.notebookServerEndpoint", "type": "str"}, - "status": {"key": "properties.status", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "resource": {"key": "properties.resource", "type": "MongoDBCollectionGetPropertiesResource"}, + "options": {"key": "properties.options", "type": "MongoDBCollectionGetPropertiesOptions"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.notebook_server_endpoint = None - self.status = None + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + resource: Optional["_models.MongoDBCollectionGetPropertiesResource"] = None, + options: Optional["_models.MongoDBCollectionGetPropertiesOptions"] = None, + **kwargs: Any + ) -> None: + """ + :keyword location: The location of the resource group to which the resource belongs. + :paramtype location: str + :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :paramtype tags: dict[str, str] + :keyword resource: + :paramtype resource: ~azure.mgmt.cosmosdb.models.MongoDBCollectionGetPropertiesResource + :keyword options: + :paramtype options: ~azure.mgmt.cosmosdb.models.MongoDBCollectionGetPropertiesOptions + """ + super().__init__(location=location, tags=tags, **kwargs) + self.resource = resource + self.options = options -class NotebookWorkspaceConnectionInfoResult(_serialization.Model): - """The connection info for the given notebook workspace. +class MongoDBCollectionListResult(_serialization.Model): + """The List operation response, that contains the MongoDB collections and their properties. Variables are only populated by the server, and will be ignored when sending a request. - :ivar auth_token: Specifies auth token used for connecting to Notebook server (uses token-based - auth). - :vartype auth_token: str - :ivar notebook_server_endpoint: Specifies the endpoint of Notebook server. - :vartype notebook_server_endpoint: str + :ivar value: List of MongoDB collections and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] """ _validation = { - "auth_token": {"readonly": True}, - "notebook_server_endpoint": {"readonly": True}, + "value": {"readonly": True}, } _attribute_map = { - "auth_token": {"key": "authToken", "type": "str"}, - "notebook_server_endpoint": {"key": "notebookServerEndpoint", "type": "str"}, + "value": {"key": "value", "type": "[MongoDBCollectionGetResults]"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.auth_token = None - self.notebook_server_endpoint = None + self.value = None -class NotebookWorkspaceCreateUpdateParameters(ARMProxyResource): - """Parameters to create a notebook workspace resource. +class MongoDBDatabaseCreateUpdateParameters(ARMResourceProperties): + """Parameters to create and update Cosmos DB MongoDB database. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The unique resource identifier of the database account. + All required parameters must be populated in order to send to server. + + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str - :ivar name: The name of the database account. + :ivar name: The name of the ARM resource. :vartype name: str :ivar type: The type of Azure resource. :vartype type: str + :ivar location: The location of the resource group to which the resource belongs. + :vartype location: str + :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :vartype tags: dict[str, str] + :ivar resource: The standard JSON format of a MongoDB database. Required. + :vartype resource: ~azure.mgmt.cosmosdb.models.MongoDBDatabaseResource + :ivar options: A key-value pair of options to be applied for the request. This corresponds to + the headers sent with the request. + :vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ - -class NotebookWorkspaceListResult(_serialization.Model): - """A list of notebook workspace resources. - - :ivar value: Array of notebook workspace resources. - :vartype value: list[~azure.mgmt.cosmosdb.models.NotebookWorkspace] - """ - - _attribute_map = { - "value": {"key": "value", "type": "[NotebookWorkspace]"}, + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "resource": {"required": True}, } - def __init__(self, *, value: Optional[List["_models.NotebookWorkspace"]] = None, **kwargs: Any) -> None: - """ - :keyword value: Array of notebook workspace resources. - :paramtype value: list[~azure.mgmt.cosmosdb.models.NotebookWorkspace] - """ - super().__init__(**kwargs) - self.value = value - - -class Operation(_serialization.Model): - """REST API operation. - - :ivar name: Operation name: {provider}/{resource}/{operation}. - :vartype name: str - :ivar display: The object that represents the operation. - :vartype display: ~azure.mgmt.cosmosdb.models.OperationDisplay - """ - _attribute_map = { + "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, - "display": {"key": "display", "type": "OperationDisplay"}, - } - - def __init__( - self, *, name: Optional[str] = None, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any - ) -> None: - """ - :keyword name: Operation name: {provider}/{resource}/{operation}. - :paramtype name: str - :keyword display: The object that represents the operation. - :paramtype display: ~azure.mgmt.cosmosdb.models.OperationDisplay - """ - super().__init__(**kwargs) - self.name = name - self.display = display - - -class OperationDisplay(_serialization.Model): - """The object that represents the operation. - - :ivar provider: Service provider: Microsoft.ResourceProvider. - :vartype provider: str - :ivar resource: Resource on which the operation is performed: Profile, endpoint, etc. - :vartype resource: str - :ivar operation: Operation type: Read, write, delete, etc. - :vartype operation: str - :ivar description: Description of operation. - :vartype description: str - """ - - _attribute_map = { - "provider": {"key": "Provider", "type": "str"}, - "resource": {"key": "Resource", "type": "str"}, - "operation": {"key": "Operation", "type": "str"}, - "description": {"key": "Description", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "resource": {"key": "properties.resource", "type": "MongoDBDatabaseResource"}, + "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, } def __init__( self, *, - provider: Optional[str] = None, - resource: Optional[str] = None, - operation: Optional[str] = None, - description: Optional[str] = None, + resource: "_models.MongoDBDatabaseResource", + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + options: Optional["_models.CreateUpdateOptions"] = None, **kwargs: Any ) -> None: """ - :keyword provider: Service provider: Microsoft.ResourceProvider. - :paramtype provider: str - :keyword resource: Resource on which the operation is performed: Profile, endpoint, etc. - :paramtype resource: str - :keyword operation: Operation type: Read, write, delete, etc. - :paramtype operation: str - :keyword description: Description of operation. - :paramtype description: str + :keyword location: The location of the resource group to which the resource belongs. + :paramtype location: str + :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :paramtype tags: dict[str, str] + :keyword resource: The standard JSON format of a MongoDB database. Required. + :paramtype resource: ~azure.mgmt.cosmosdb.models.MongoDBDatabaseResource + :keyword options: A key-value pair of options to be applied for the request. This corresponds + to the headers sent with the request. + :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ - super().__init__(**kwargs) - self.provider = provider + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource - self.operation = operation - self.description = description - - -class OperationListResult(_serialization.Model): - """Result of the request to list Resource Provider operations. It contains a list of operations - and a URL link to get the next set of results. - - :ivar value: List of operations supported by the Resource Provider. - :vartype value: list[~azure.mgmt.cosmosdb.models.Operation] - :ivar next_link: URL to get the next set of operation list results if there are any. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[Operation]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: Optional[List["_models.Operation"]] = None, next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: List of operations supported by the Resource Provider. - :paramtype value: list[~azure.mgmt.cosmosdb.models.Operation] - :keyword next_link: URL to get the next set of operation list results if there are any. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class PartitionMetric(Metric): - """The metric values for a single partition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar start_time: The start time for the metric (ISO-8601 format). - :vartype start_time: ~datetime.datetime - :ivar end_time: The end time for the metric (ISO-8601 format). - :vartype end_time: ~datetime.datetime - :ivar time_grain: The time grain to be used to summarize the metric values. - :vartype time_grain: str - :ivar unit: The unit of the metric. Known values are: "Count", "Bytes", "Seconds", "Percent", - "CountPerSecond", "BytesPerSecond", and "Milliseconds". - :vartype unit: str or ~azure.mgmt.cosmosdb.models.UnitType - :ivar name: The name information for the metric. - :vartype name: ~azure.mgmt.cosmosdb.models.MetricName - :ivar metric_values: The metric values for the specified time window and timestep. - :vartype metric_values: list[~azure.mgmt.cosmosdb.models.MetricValue] - :ivar partition_id: The partition id (GUID identifier) of the metric values. - :vartype partition_id: str - :ivar partition_key_range_id: The partition key range id (integer identifier) of the metric - values. - :vartype partition_key_range_id: str - """ + self.options = options - _validation = { - "start_time": {"readonly": True}, - "end_time": {"readonly": True}, - "time_grain": {"readonly": True}, - "unit": {"readonly": True}, - "name": {"readonly": True}, - "metric_values": {"readonly": True}, - "partition_id": {"readonly": True}, - "partition_key_range_id": {"readonly": True}, - } - _attribute_map = { - "start_time": {"key": "startTime", "type": "iso-8601"}, - "end_time": {"key": "endTime", "type": "iso-8601"}, - "time_grain": {"key": "timeGrain", "type": "str"}, - "unit": {"key": "unit", "type": "str"}, - "name": {"key": "name", "type": "MetricName"}, - "metric_values": {"key": "metricValues", "type": "[MetricValue]"}, - "partition_id": {"key": "partitionId", "type": "str"}, - "partition_key_range_id": {"key": "partitionKeyRangeId", "type": "str"}, - } +class MongoDBDatabaseGetPropertiesOptions(OptionsResource): + """MongoDBDatabaseGetPropertiesOptions. - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.partition_id = None - self.partition_key_range_id = None + :ivar throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the + ThroughputSetting resource when retrieving offer details. + :vartype throughput: int + :ivar autoscale_settings: Specifies the Autoscale settings. + :vartype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings + """ -class PartitionMetricListResult(_serialization.Model): - """The response to a list partition metrics request. +class MongoDBDatabaseResource(_serialization.Model): + """Cosmos DB MongoDB database resource object. - 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 value: The list of partition-level metrics for the account. - :vartype value: list[~azure.mgmt.cosmosdb.models.PartitionMetric] + :ivar id: Name of the Cosmos DB MongoDB database. Required. + :vartype id: str + :ivar restore_parameters: Parameters to indicate the information about the restore. + :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" + and "Restore". + :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode """ _validation = { - "value": {"readonly": True}, + "id": {"required": True}, } _attribute_map = { - "value": {"key": "value", "type": "[PartitionMetric]"}, + "id": {"key": "id", "type": "str"}, + "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, + "create_mode": {"key": "createMode", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, + create_mode: Union[str, "_models.CreateMode"] = "Default", + **kwargs: Any + ) -> None: + """ + :keyword id: Name of the Cosmos DB MongoDB database. Required. + :paramtype id: str + :keyword restore_parameters: Parameters to indicate the information about the restore. + :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: + "Default" and "Restore". + :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + """ super().__init__(**kwargs) - self.value = None + self.id = id + self.restore_parameters = restore_parameters + self.create_mode = create_mode -class Usage(_serialization.Model): - """The usage data for a usage request. +class MongoDBDatabaseGetPropertiesResource(MongoDBDatabaseResource, ExtendedResourceProperties): + """MongoDBDatabaseGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar unit: The unit of the metric. Known values are: "Count", "Bytes", "Seconds", "Percent", - "CountPerSecond", "BytesPerSecond", and "Milliseconds". - :vartype unit: str or ~azure.mgmt.cosmosdb.models.UnitType - :ivar name: The name information for the metric. - :vartype name: ~azure.mgmt.cosmosdb.models.MetricName - :ivar quota_period: The quota period used to summarize the usage values. - :vartype quota_period: str - :ivar limit: Maximum value for this metric. - :vartype limit: int - :ivar current_value: Current value for this metric. - :vartype current_value: int + All required parameters must be populated in order to send to server. + + :ivar rid: A system generated property. A unique identifier. + :vartype rid: str + :ivar ts: A system generated property that denotes the last updated timestamp of the resource. + :vartype ts: float + :ivar etag: A system generated property representing the resource etag required for optimistic + concurrency control. + :vartype etag: str + :ivar id: Name of the Cosmos DB MongoDB database. Required. + :vartype id: str + :ivar restore_parameters: Parameters to indicate the information about the restore. + :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" + and "Restore". + :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode """ _validation = { - "unit": {"readonly": True}, - "name": {"readonly": True}, - "quota_period": {"readonly": True}, - "limit": {"readonly": True}, - "current_value": {"readonly": True}, + "rid": {"readonly": True}, + "ts": {"readonly": True}, + "etag": {"readonly": True}, + "id": {"required": True}, } _attribute_map = { - "unit": {"key": "unit", "type": "str"}, - "name": {"key": "name", "type": "MetricName"}, - "quota_period": {"key": "quotaPeriod", "type": "str"}, - "limit": {"key": "limit", "type": "int"}, - "current_value": {"key": "currentValue", "type": "int"}, + "rid": {"key": "_rid", "type": "str"}, + "ts": {"key": "_ts", "type": "float"}, + "etag": {"key": "_etag", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, + "create_mode": {"key": "createMode", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.unit = None - self.name = None - self.quota_period = None - self.limit = None - self.current_value = None + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, + create_mode: Union[str, "_models.CreateMode"] = "Default", + **kwargs: Any + ) -> None: + """ + :keyword id: Name of the Cosmos DB MongoDB database. Required. + :paramtype id: str + :keyword restore_parameters: Parameters to indicate the information about the restore. + :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: + "Default" and "Restore". + :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + """ + super().__init__(id=id, restore_parameters=restore_parameters, create_mode=create_mode, **kwargs) + self.rid = None + self.ts = None + self.etag = None + self.id = id + self.restore_parameters = restore_parameters + self.create_mode = create_mode -class PartitionUsage(Usage): - """The partition level usage data for a usage request. +class MongoDBDatabaseGetResults(ARMResourceProperties): + """An Azure Cosmos DB MongoDB database. Variables are only populated by the server, and will be ignored when sending a request. - :ivar unit: The unit of the metric. Known values are: "Count", "Bytes", "Seconds", "Percent", - "CountPerSecond", "BytesPerSecond", and "Milliseconds". - :vartype unit: str or ~azure.mgmt.cosmosdb.models.UnitType - :ivar name: The name information for the metric. - :vartype name: ~azure.mgmt.cosmosdb.models.MetricName - :ivar quota_period: The quota period used to summarize the usage values. - :vartype quota_period: str - :ivar limit: Maximum value for this metric. - :vartype limit: int - :ivar current_value: Current value for this metric. - :vartype current_value: int - :ivar partition_id: The partition id (GUID identifier) of the usages. - :vartype partition_id: str - :ivar partition_key_range_id: The partition key range id (integer identifier) of the usages. - :vartype partition_key_range_id: str + :ivar id: The unique resource identifier of the ARM resource. + :vartype id: str + :ivar name: The name of the ARM resource. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :ivar location: The location of the resource group to which the resource belongs. + :vartype location: str + :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :vartype tags: dict[str, str] + :ivar resource: + :vartype resource: ~azure.mgmt.cosmosdb.models.MongoDBDatabaseGetPropertiesResource + :ivar options: + :vartype options: ~azure.mgmt.cosmosdb.models.MongoDBDatabaseGetPropertiesOptions """ _validation = { - "unit": {"readonly": True}, + "id": {"readonly": True}, "name": {"readonly": True}, - "quota_period": {"readonly": True}, - "limit": {"readonly": True}, - "current_value": {"readonly": True}, - "partition_id": {"readonly": True}, - "partition_key_range_id": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { - "unit": {"key": "unit", "type": "str"}, - "name": {"key": "name", "type": "MetricName"}, - "quota_period": {"key": "quotaPeriod", "type": "str"}, - "limit": {"key": "limit", "type": "int"}, - "current_value": {"key": "currentValue", "type": "int"}, - "partition_id": {"key": "partitionId", "type": "str"}, - "partition_key_range_id": {"key": "partitionKeyRangeId", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "resource": {"key": "properties.resource", "type": "MongoDBDatabaseGetPropertiesResource"}, + "options": {"key": "properties.options", "type": "MongoDBDatabaseGetPropertiesOptions"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.partition_id = None - self.partition_key_range_id = None + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + resource: Optional["_models.MongoDBDatabaseGetPropertiesResource"] = None, + options: Optional["_models.MongoDBDatabaseGetPropertiesOptions"] = None, + **kwargs: Any + ) -> None: + """ + :keyword location: The location of the resource group to which the resource belongs. + :paramtype location: str + :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :paramtype tags: dict[str, str] + :keyword resource: + :paramtype resource: ~azure.mgmt.cosmosdb.models.MongoDBDatabaseGetPropertiesResource + :keyword options: + :paramtype options: ~azure.mgmt.cosmosdb.models.MongoDBDatabaseGetPropertiesOptions + """ + super().__init__(location=location, tags=tags, **kwargs) + self.resource = resource + self.options = options -class PartitionUsagesResult(_serialization.Model): - """The response to a list partition level usage request. +class MongoDBDatabaseListResult(_serialization.Model): + """The List operation response, that contains the MongoDB databases and their properties. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: The list of partition-level usages for the database. A usage is a point in time - metric. - :vartype value: list[~azure.mgmt.cosmosdb.models.PartitionUsage] + :ivar value: List of MongoDB databases and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.MongoDBDatabaseGetResults] """ _validation = { @@ -10606,7 +7515,7 @@ class PartitionUsagesResult(_serialization.Model): } _attribute_map = { - "value": {"key": "value", "type": "[PartitionUsage]"}, + "value": {"key": "value", "type": "[MongoDBDatabaseGetResults]"}, } def __init__(self, **kwargs: Any) -> None: @@ -10615,1289 +7524,1168 @@ def __init__(self, **kwargs: Any) -> None: self.value = None -class PercentileMetric(_serialization.Model): - """Percentile Metric data. - - Variables are only populated by the server, and will be ignored when sending a request. +class MongoIndex(_serialization.Model): + """Cosmos DB MongoDB collection index key. - :ivar start_time: The start time for the metric (ISO-8601 format). - :vartype start_time: ~datetime.datetime - :ivar end_time: The end time for the metric (ISO-8601 format). - :vartype end_time: ~datetime.datetime - :ivar time_grain: The time grain to be used to summarize the metric values. - :vartype time_grain: str - :ivar unit: The unit of the metric. Known values are: "Count", "Bytes", "Seconds", "Percent", - "CountPerSecond", "BytesPerSecond", and "Milliseconds". - :vartype unit: str or ~azure.mgmt.cosmosdb.models.UnitType - :ivar name: The name information for the metric. - :vartype name: ~azure.mgmt.cosmosdb.models.MetricName - :ivar metric_values: The percentile metric values for the specified time window and timestep. - :vartype metric_values: list[~azure.mgmt.cosmosdb.models.PercentileMetricValue] + :ivar key: Cosmos DB MongoDB collection index keys. + :vartype key: ~azure.mgmt.cosmosdb.models.MongoIndexKeys + :ivar options: Cosmos DB MongoDB collection index key options. + :vartype options: ~azure.mgmt.cosmosdb.models.MongoIndexOptions """ - _validation = { - "start_time": {"readonly": True}, - "end_time": {"readonly": True}, - "time_grain": {"readonly": True}, - "unit": {"readonly": True}, - "name": {"readonly": True}, - "metric_values": {"readonly": True}, - } - _attribute_map = { - "start_time": {"key": "startTime", "type": "iso-8601"}, - "end_time": {"key": "endTime", "type": "iso-8601"}, - "time_grain": {"key": "timeGrain", "type": "str"}, - "unit": {"key": "unit", "type": "str"}, - "name": {"key": "name", "type": "MetricName"}, - "metric_values": {"key": "metricValues", "type": "[PercentileMetricValue]"}, + "key": {"key": "key", "type": "MongoIndexKeys"}, + "options": {"key": "options", "type": "MongoIndexOptions"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + key: Optional["_models.MongoIndexKeys"] = None, + options: Optional["_models.MongoIndexOptions"] = None, + **kwargs: Any + ) -> None: + """ + :keyword key: Cosmos DB MongoDB collection index keys. + :paramtype key: ~azure.mgmt.cosmosdb.models.MongoIndexKeys + :keyword options: Cosmos DB MongoDB collection index key options. + :paramtype options: ~azure.mgmt.cosmosdb.models.MongoIndexOptions + """ super().__init__(**kwargs) - self.start_time = None - self.end_time = None - self.time_grain = None - self.unit = None - self.name = None - self.metric_values = None - + self.key = key + self.options = options -class PercentileMetricListResult(_serialization.Model): - """The response to a list percentile metrics request. - Variables are only populated by the server, and will be ignored when sending a request. +class MongoIndexKeys(_serialization.Model): + """Cosmos DB MongoDB collection resource object. - :ivar value: The list of percentile metrics for the account. - :vartype value: list[~azure.mgmt.cosmosdb.models.PercentileMetric] + :ivar keys: List of keys for each MongoDB collection in the Azure Cosmos DB service. + :vartype keys: list[str] """ - _validation = { - "value": {"readonly": True}, - } - _attribute_map = { - "value": {"key": "value", "type": "[PercentileMetric]"}, + "keys": {"key": "keys", "type": "[str]"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, keys: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword keys: List of keys for each MongoDB collection in the Azure Cosmos DB service. + :paramtype keys: list[str] + """ super().__init__(**kwargs) - self.value = None - + self.keys = keys -class PercentileMetricValue(MetricValue): - """Represents percentile metrics values. - Variables are only populated by the server, and will be ignored when sending a request. +class MongoIndexOptions(_serialization.Model): + """Cosmos DB MongoDB collection index options. - :ivar count: The number of values for the metric. - :vartype count: int - :ivar average: The average value of the metric. - :vartype average: float - :ivar maximum: The max value of the metric. - :vartype maximum: float - :ivar minimum: The min value of the metric. - :vartype minimum: float - :ivar timestamp: The metric timestamp (ISO-8601 format). - :vartype timestamp: ~datetime.datetime - :ivar total: The total value of the metric. - :vartype total: float - :ivar p10: The 10th percentile value for the metric. - :vartype p10: float - :ivar p25: The 25th percentile value for the metric. - :vartype p25: float - :ivar p50: The 50th percentile value for the metric. - :vartype p50: float - :ivar p75: The 75th percentile value for the metric. - :vartype p75: float - :ivar p90: The 90th percentile value for the metric. - :vartype p90: float - :ivar p95: The 95th percentile value for the metric. - :vartype p95: float - :ivar p99: The 99th percentile value for the metric. - :vartype p99: float + :ivar expire_after_seconds: Expire after seconds. + :vartype expire_after_seconds: int + :ivar unique: Is unique or not. + :vartype unique: bool """ - _validation = { - "count": {"readonly": True}, - "average": {"readonly": True}, - "maximum": {"readonly": True}, - "minimum": {"readonly": True}, - "timestamp": {"readonly": True}, - "total": {"readonly": True}, - "p10": {"readonly": True}, - "p25": {"readonly": True}, - "p50": {"readonly": True}, - "p75": {"readonly": True}, - "p90": {"readonly": True}, - "p95": {"readonly": True}, - "p99": {"readonly": True}, - } - _attribute_map = { - "count": {"key": "_count", "type": "int"}, - "average": {"key": "average", "type": "float"}, - "maximum": {"key": "maximum", "type": "float"}, - "minimum": {"key": "minimum", "type": "float"}, - "timestamp": {"key": "timestamp", "type": "iso-8601"}, - "total": {"key": "total", "type": "float"}, - "p10": {"key": "P10", "type": "float"}, - "p25": {"key": "P25", "type": "float"}, - "p50": {"key": "P50", "type": "float"}, - "p75": {"key": "P75", "type": "float"}, - "p90": {"key": "P90", "type": "float"}, - "p95": {"key": "P95", "type": "float"}, - "p99": {"key": "P99", "type": "float"}, + "expire_after_seconds": {"key": "expireAfterSeconds", "type": "int"}, + "unique": {"key": "unique", "type": "bool"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, *, expire_after_seconds: Optional[int] = None, unique: Optional[bool] = None, **kwargs: Any + ) -> None: + """ + :keyword expire_after_seconds: Expire after seconds. + :paramtype expire_after_seconds: int + :keyword unique: Is unique or not. + :paramtype unique: bool + """ super().__init__(**kwargs) - self.p10 = None - self.p25 = None - self.p50 = None - self.p75 = None - self.p90 = None - self.p95 = None - self.p99 = None + self.expire_after_seconds = expire_after_seconds + self.unique = unique -class PeriodicModeBackupPolicy(BackupPolicy): - """The object representing periodic mode backup policy. +class MongoRoleDefinitionCreateUpdateParameters(_serialization.Model): # pylint: disable=name-too-long + """Parameters to create and update an Azure Cosmos DB Mongo Role Definition. - All required parameters must be populated in order to send to server. + :ivar role_name: A user-friendly name for the Role Definition. Must be unique for the database + account. + :vartype role_name: str + :ivar type: Indicates whether the Role Definition was built-in or user created. Known values + are: "BuiltInRole" and "CustomRole". + :vartype type: str or ~azure.mgmt.cosmosdb.models.MongoRoleDefinitionType + :ivar database_name: The database name for which access is being granted for this Role + Definition. + :vartype database_name: str + :ivar privileges: A set of privileges contained by the Role Definition. This will allow + application of this Role Definition on the entire database account or any underlying Database / + Collection. Scopes higher than Database are not enforceable as privilege. + :vartype privileges: list[~azure.mgmt.cosmosdb.models.Privilege] + :ivar roles: The set of roles inherited by this Role Definition. + :vartype roles: list[~azure.mgmt.cosmosdb.models.Role] + """ - :ivar type: Describes the mode of backups. Required. Known values are: "Periodic" and - "Continuous". - :vartype type: str or ~azure.mgmt.cosmosdb.models.BackupPolicyType - :ivar migration_state: The object representing the state of the migration between the backup - policies. - :vartype migration_state: ~azure.mgmt.cosmosdb.models.BackupPolicyMigrationState - :ivar periodic_mode_properties: Configuration values for periodic mode backup. - :vartype periodic_mode_properties: ~azure.mgmt.cosmosdb.models.PeriodicModeProperties + _attribute_map = { + "role_name": {"key": "properties.roleName", "type": "str"}, + "type": {"key": "properties.type", "type": "str"}, + "database_name": {"key": "properties.databaseName", "type": "str"}, + "privileges": {"key": "properties.privileges", "type": "[Privilege]"}, + "roles": {"key": "properties.roles", "type": "[Role]"}, + } + + def __init__( + self, + *, + role_name: Optional[str] = None, + type: Optional[Union[str, "_models.MongoRoleDefinitionType"]] = None, + database_name: Optional[str] = None, + privileges: Optional[List["_models.Privilege"]] = None, + roles: Optional[List["_models.Role"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword role_name: A user-friendly name for the Role Definition. Must be unique for the + database account. + :paramtype role_name: str + :keyword type: Indicates whether the Role Definition was built-in or user created. Known values + are: "BuiltInRole" and "CustomRole". + :paramtype type: str or ~azure.mgmt.cosmosdb.models.MongoRoleDefinitionType + :keyword database_name: The database name for which access is being granted for this Role + Definition. + :paramtype database_name: str + :keyword privileges: A set of privileges contained by the Role Definition. This will allow + application of this Role Definition on the entire database account or any underlying Database / + Collection. Scopes higher than Database are not enforceable as privilege. + :paramtype privileges: list[~azure.mgmt.cosmosdb.models.Privilege] + :keyword roles: The set of roles inherited by this Role Definition. + :paramtype roles: list[~azure.mgmt.cosmosdb.models.Role] + """ + super().__init__(**kwargs) + self.role_name = role_name + self.type = type + self.database_name = database_name + self.privileges = privileges + self.roles = roles + + +class MongoRoleDefinitionGetResults(ARMProxyResource): + """An Azure Cosmos DB Mongo Role Definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The unique resource identifier of the database account. + :vartype id: str + :ivar name: The name of the database account. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :ivar role_name: A user-friendly name for the Role Definition. Must be unique for the database + account. + :vartype role_name: str + :ivar type_properties_type: Indicates whether the Role Definition was built-in or user created. + Known values are: "BuiltInRole" and "CustomRole". + :vartype type_properties_type: str or ~azure.mgmt.cosmosdb.models.MongoRoleDefinitionType + :ivar database_name: The database name for which access is being granted for this Role + Definition. + :vartype database_name: str + :ivar privileges: A set of privileges contained by the Role Definition. This will allow + application of this Role Definition on the entire database account or any underlying Database / + Collection. Scopes higher than Database are not enforceable as privilege. + :vartype privileges: list[~azure.mgmt.cosmosdb.models.Privilege] + :ivar roles: The set of roles inherited by this Role Definition. + :vartype roles: list[~azure.mgmt.cosmosdb.models.Role] """ _validation = { - "type": {"required": True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "migration_state": {"key": "migrationState", "type": "BackupPolicyMigrationState"}, - "periodic_mode_properties": {"key": "periodicModeProperties", "type": "PeriodicModeProperties"}, + "role_name": {"key": "properties.roleName", "type": "str"}, + "type_properties_type": {"key": "properties.type", "type": "str"}, + "database_name": {"key": "properties.databaseName", "type": "str"}, + "privileges": {"key": "properties.privileges", "type": "[Privilege]"}, + "roles": {"key": "properties.roles", "type": "[Role]"}, } def __init__( self, *, - migration_state: Optional["_models.BackupPolicyMigrationState"] = None, - periodic_mode_properties: Optional["_models.PeriodicModeProperties"] = None, + role_name: Optional[str] = None, + type_properties_type: Optional[Union[str, "_models.MongoRoleDefinitionType"]] = None, + database_name: Optional[str] = None, + privileges: Optional[List["_models.Privilege"]] = None, + roles: Optional[List["_models.Role"]] = None, **kwargs: Any ) -> None: """ - :keyword migration_state: The object representing the state of the migration between the backup - policies. - :paramtype migration_state: ~azure.mgmt.cosmosdb.models.BackupPolicyMigrationState - :keyword periodic_mode_properties: Configuration values for periodic mode backup. - :paramtype periodic_mode_properties: ~azure.mgmt.cosmosdb.models.PeriodicModeProperties + :keyword role_name: A user-friendly name for the Role Definition. Must be unique for the + database account. + :paramtype role_name: str + :keyword type_properties_type: Indicates whether the Role Definition was built-in or user + created. Known values are: "BuiltInRole" and "CustomRole". + :paramtype type_properties_type: str or ~azure.mgmt.cosmosdb.models.MongoRoleDefinitionType + :keyword database_name: The database name for which access is being granted for this Role + Definition. + :paramtype database_name: str + :keyword privileges: A set of privileges contained by the Role Definition. This will allow + application of this Role Definition on the entire database account or any underlying Database / + Collection. Scopes higher than Database are not enforceable as privilege. + :paramtype privileges: list[~azure.mgmt.cosmosdb.models.Privilege] + :keyword roles: The set of roles inherited by this Role Definition. + :paramtype roles: list[~azure.mgmt.cosmosdb.models.Role] """ - super().__init__(migration_state=migration_state, **kwargs) - self.type: str = "Periodic" - self.periodic_mode_properties = periodic_mode_properties + super().__init__(**kwargs) + self.role_name = role_name + self.type_properties_type = type_properties_type + self.database_name = database_name + self.privileges = privileges + self.roles = roles -class PeriodicModeProperties(_serialization.Model): - """Configuration values for periodic mode backup. +class MongoRoleDefinitionListResult(_serialization.Model): + """The relevant Mongo Role Definitions. - :ivar backup_interval_in_minutes: An integer representing the interval in minutes between two - backups. - :vartype backup_interval_in_minutes: int - :ivar backup_retention_interval_in_hours: An integer representing the time (in hours) that each - backup is retained. - :vartype backup_retention_interval_in_hours: int - :ivar backup_storage_redundancy: Enum to indicate type of backup residency. Known values are: - "Geo", "Local", and "Zone". - :vartype backup_storage_redundancy: str or ~azure.mgmt.cosmosdb.models.BackupStorageRedundancy + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Mongo Role Definitions and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.MongoRoleDefinitionGetResults] """ _validation = { - "backup_interval_in_minutes": {"minimum": 0}, - "backup_retention_interval_in_hours": {"minimum": 0}, + "value": {"readonly": True}, } _attribute_map = { - "backup_interval_in_minutes": {"key": "backupIntervalInMinutes", "type": "int"}, - "backup_retention_interval_in_hours": {"key": "backupRetentionIntervalInHours", "type": "int"}, - "backup_storage_redundancy": {"key": "backupStorageRedundancy", "type": "str"}, + "value": {"key": "value", "type": "[MongoRoleDefinitionGetResults]"}, } - def __init__( - self, - *, - backup_interval_in_minutes: Optional[int] = None, - backup_retention_interval_in_hours: Optional[int] = None, - backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword backup_interval_in_minutes: An integer representing the interval in minutes between - two backups. - :paramtype backup_interval_in_minutes: int - :keyword backup_retention_interval_in_hours: An integer representing the time (in hours) that - each backup is retained. - :paramtype backup_retention_interval_in_hours: int - :keyword backup_storage_redundancy: Enum to indicate type of backup residency. Known values - are: "Geo", "Local", and "Zone". - :paramtype backup_storage_redundancy: str or - ~azure.mgmt.cosmosdb.models.BackupStorageRedundancy - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.backup_interval_in_minutes = backup_interval_in_minutes - self.backup_retention_interval_in_hours = backup_retention_interval_in_hours - self.backup_storage_redundancy = backup_storage_redundancy + self.value = None -class Permission(_serialization.Model): - """The set of data plane operations permitted through this Role Definition. +class MongoUserDefinitionCreateUpdateParameters(_serialization.Model): # pylint: disable=name-too-long + """Parameters to create and update an Azure Cosmos DB Mongo User Definition. - :ivar data_actions: An array of data actions that are allowed. - :vartype data_actions: list[str] - :ivar not_data_actions: An array of data actions that are denied. - :vartype not_data_actions: list[str] + :ivar user_name: The user name for User Definition. + :vartype user_name: str + :ivar password: The password for User Definition. Response does not contain user password. + :vartype password: str + :ivar database_name: The database name for which access is being granted for this User + Definition. + :vartype database_name: str + :ivar custom_data: A custom definition for the USer Definition. + :vartype custom_data: str + :ivar roles: The set of roles inherited by the User Definition. + :vartype roles: list[~azure.mgmt.cosmosdb.models.Role] + :ivar mechanisms: The Mongo Auth mechanism. For now, we only support auth mechanism + SCRAM-SHA-256. + :vartype mechanisms: str """ _attribute_map = { - "data_actions": {"key": "dataActions", "type": "[str]"}, - "not_data_actions": {"key": "notDataActions", "type": "[str]"}, + "user_name": {"key": "properties.userName", "type": "str"}, + "password": {"key": "properties.password", "type": "str"}, + "database_name": {"key": "properties.databaseName", "type": "str"}, + "custom_data": {"key": "properties.customData", "type": "str"}, + "roles": {"key": "properties.roles", "type": "[Role]"}, + "mechanisms": {"key": "properties.mechanisms", "type": "str"}, } def __init__( - self, *, data_actions: Optional[List[str]] = None, not_data_actions: Optional[List[str]] = None, **kwargs: Any + self, + *, + user_name: Optional[str] = None, + password: Optional[str] = None, + database_name: Optional[str] = None, + custom_data: Optional[str] = None, + roles: Optional[List["_models.Role"]] = None, + mechanisms: Optional[str] = None, + **kwargs: Any ) -> None: """ - :keyword data_actions: An array of data actions that are allowed. - :paramtype data_actions: list[str] - :keyword not_data_actions: An array of data actions that are denied. - :paramtype not_data_actions: list[str] + :keyword user_name: The user name for User Definition. + :paramtype user_name: str + :keyword password: The password for User Definition. Response does not contain user password. + :paramtype password: str + :keyword database_name: The database name for which access is being granted for this User + Definition. + :paramtype database_name: str + :keyword custom_data: A custom definition for the USer Definition. + :paramtype custom_data: str + :keyword roles: The set of roles inherited by the User Definition. + :paramtype roles: list[~azure.mgmt.cosmosdb.models.Role] + :keyword mechanisms: The Mongo Auth mechanism. For now, we only support auth mechanism + SCRAM-SHA-256. + :paramtype mechanisms: str """ super().__init__(**kwargs) - self.data_actions = data_actions - self.not_data_actions = not_data_actions + self.user_name = user_name + self.password = password + self.database_name = database_name + self.custom_data = custom_data + self.roles = roles + self.mechanisms = mechanisms -class PermissionAutoGenerated(_serialization.Model): - """The set of data plane operations permitted through this Role Definition. +class MongoUserDefinitionGetResults(ARMProxyResource): + """An Azure Cosmos DB User Definition. - :ivar id: The id for the permission. + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The unique resource identifier of the database account. :vartype id: str - :ivar data_actions: An array of data actions that are allowed. - :vartype data_actions: list[str] - :ivar not_data_actions: An array of data actions that are denied. - :vartype not_data_actions: list[str] + :ivar name: The name of the database account. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :ivar user_name: The user name for User Definition. + :vartype user_name: str + :ivar password: The password for User Definition. Response does not contain user password. + :vartype password: str + :ivar database_name: The database name for which access is being granted for this User + Definition. + :vartype database_name: str + :ivar custom_data: A custom definition for the USer Definition. + :vartype custom_data: str + :ivar roles: The set of roles inherited by the User Definition. + :vartype roles: list[~azure.mgmt.cosmosdb.models.Role] + :ivar mechanisms: The Mongo Auth mechanism. For now, we only support auth mechanism + SCRAM-SHA-256. + :vartype mechanisms: str """ + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + } + _attribute_map = { "id": {"key": "id", "type": "str"}, - "data_actions": {"key": "dataActions", "type": "[str]"}, - "not_data_actions": {"key": "notDataActions", "type": "[str]"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_name": {"key": "properties.userName", "type": "str"}, + "password": {"key": "properties.password", "type": "str"}, + "database_name": {"key": "properties.databaseName", "type": "str"}, + "custom_data": {"key": "properties.customData", "type": "str"}, + "roles": {"key": "properties.roles", "type": "[Role]"}, + "mechanisms": {"key": "properties.mechanisms", "type": "str"}, } def __init__( self, *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - data_actions: Optional[List[str]] = None, - not_data_actions: Optional[List[str]] = None, + user_name: Optional[str] = None, + password: Optional[str] = None, + database_name: Optional[str] = None, + custom_data: Optional[str] = None, + roles: Optional[List["_models.Role"]] = None, + mechanisms: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword id: The id for the permission. - :paramtype id: str - :keyword data_actions: An array of data actions that are allowed. - :paramtype data_actions: list[str] - :keyword not_data_actions: An array of data actions that are denied. - :paramtype not_data_actions: list[str] + :keyword user_name: The user name for User Definition. + :paramtype user_name: str + :keyword password: The password for User Definition. Response does not contain user password. + :paramtype password: str + :keyword database_name: The database name for which access is being granted for this User + Definition. + :paramtype database_name: str + :keyword custom_data: A custom definition for the USer Definition. + :paramtype custom_data: str + :keyword roles: The set of roles inherited by the User Definition. + :paramtype roles: list[~azure.mgmt.cosmosdb.models.Role] + :keyword mechanisms: The Mongo Auth mechanism. For now, we only support auth mechanism + SCRAM-SHA-256. + :paramtype mechanisms: str """ super().__init__(**kwargs) - self.id = id - self.data_actions = data_actions - self.not_data_actions = not_data_actions + self.user_name = user_name + self.password = password + self.database_name = database_name + self.custom_data = custom_data + self.roles = roles + self.mechanisms = mechanisms -class PhysicalPartitionId(_serialization.Model): - """PhysicalPartitionId object. +class MongoUserDefinitionListResult(_serialization.Model): + """The relevant User Definition. - All required parameters must be populated in order to send to server. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Id of a physical partition. Required. - :vartype id: str + :ivar value: List of User Definition and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.MongoUserDefinitionGetResults] """ _validation = { - "id": {"required": True}, + "value": {"readonly": True}, } _attribute_map = { - "id": {"key": "id", "type": "str"}, + "value": {"key": "value", "type": "[MongoUserDefinitionGetResults]"}, } - def __init__(self, *, id: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin - """ - :keyword id: Id of a physical partition. Required. - :paramtype id: str - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.id = id + self.value = None -class PhysicalPartitionStorageInfo(_serialization.Model): - """The storage of a physical partition. +class NotebookWorkspace(ARMProxyResource): + """A notebook workspace resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The unique identifier of the partition. + :ivar id: The unique resource identifier of the database account. :vartype id: str - :ivar storage_in_kb: The storage in KB for the physical partition. - :vartype storage_in_kb: float + :ivar name: The name of the database account. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :ivar notebook_server_endpoint: Specifies the endpoint of Notebook server. + :vartype notebook_server_endpoint: str + :ivar status: Status of the notebook workspace. Possible values are: Creating, Online, + Deleting, Failed, Updating. + :vartype status: str """ _validation = { "id": {"readonly": True}, - "storage_in_kb": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "notebook_server_endpoint": {"readonly": True}, + "status": {"readonly": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, - "storage_in_kb": {"key": "storageInKB", "type": "float"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "notebook_server_endpoint": {"key": "properties.notebookServerEndpoint", "type": "str"}, + "status": {"key": "properties.status", "type": "str"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.id = None - self.storage_in_kb = None + self.notebook_server_endpoint = None + self.status = None -class PhysicalPartitionStorageInfoCollection(_serialization.Model): - """List of physical partitions and their properties returned by a merge operation. +class NotebookWorkspaceConnectionInfoResult(_serialization.Model): + """The connection info for the given notebook workspace. Variables are only populated by the server, and will be ignored when sending a request. - :ivar physical_partition_storage_info_collection: List of physical partitions and their - properties. - :vartype physical_partition_storage_info_collection: - list[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfo] + :ivar auth_token: Specifies auth token used for connecting to Notebook server (uses token-based + auth). + :vartype auth_token: str + :ivar notebook_server_endpoint: Specifies the endpoint of Notebook server. + :vartype notebook_server_endpoint: str """ _validation = { - "physical_partition_storage_info_collection": {"readonly": True}, + "auth_token": {"readonly": True}, + "notebook_server_endpoint": {"readonly": True}, } _attribute_map = { - "physical_partition_storage_info_collection": { - "key": "physicalPartitionStorageInfoCollection", - "type": "[PhysicalPartitionStorageInfo]", - }, + "auth_token": {"key": "authToken", "type": "str"}, + "notebook_server_endpoint": {"key": "notebookServerEndpoint", "type": "str"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.physical_partition_storage_info_collection = None - - -class PhysicalPartitionThroughputInfoProperties(_serialization.Model): # pylint: disable=name-too-long - """The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoProperties object. - - :ivar physical_partition_throughput_info: Array of physical partition throughput info objects. - :vartype physical_partition_throughput_info: - list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource] - """ - - _attribute_map = { - "physical_partition_throughput_info": { - "key": "physicalPartitionThroughputInfo", - "type": "[PhysicalPartitionThroughputInfoResource]", - }, - } - - def __init__( - self, - *, - physical_partition_throughput_info: Optional[List["_models.PhysicalPartitionThroughputInfoResource"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword physical_partition_throughput_info: Array of physical partition throughput info - objects. - :paramtype physical_partition_throughput_info: - list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource] - """ - super().__init__(**kwargs) - self.physical_partition_throughput_info = physical_partition_throughput_info - - -class PhysicalPartitionThroughputInfoResource(_serialization.Model): - """PhysicalPartitionThroughputInfo object. - - All required parameters must be populated in order to send to server. - - :ivar id: Id of a physical partition. Required. - :vartype id: str - :ivar throughput: Throughput of a physical partition. - :vartype throughput: float - """ - - _validation = { - "id": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "throughput": {"key": "throughput", "type": "float"}, - } - - def __init__( - self, *, id: str, throughput: Optional[float] = None, **kwargs: Any # pylint: disable=redefined-builtin - ) -> None: - """ - :keyword id: Id of a physical partition. Required. - :paramtype id: str - :keyword throughput: Throughput of a physical partition. - :paramtype throughput: float - """ - super().__init__(**kwargs) - self.id = id - self.throughput = throughput + self.auth_token = None + self.notebook_server_endpoint = None -class PhysicalPartitionThroughputInfoResult(ARMResourceProperties): - """An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. +class NotebookWorkspaceCreateUpdateParameters(ARMProxyResource): + """Parameters to create a notebook workspace resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The unique resource identifier of the ARM resource. + :ivar id: The unique resource identifier of the database account. :vartype id: str - :ivar name: The name of the ARM resource. + :ivar name: The name of the database account. :vartype name: str :ivar type: The type of Azure resource. :vartype type: str - :ivar location: The location of the resource group to which the resource belongs. - :vartype location: str - :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :ivar resource: properties of physical partition throughput info. - :vartype resource: - ~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResultPropertiesResource """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - } + +class NotebookWorkspaceListResult(_serialization.Model): + """A list of notebook workspace resources. + + :ivar value: Array of notebook workspace resources. + :vartype value: list[~azure.mgmt.cosmosdb.models.NotebookWorkspace] + """ _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "resource": {"key": "properties.resource", "type": "PhysicalPartitionThroughputInfoResultPropertiesResource"}, + "value": {"key": "value", "type": "[NotebookWorkspace]"}, } - def __init__( - self, - *, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - resource: Optional["_models.PhysicalPartitionThroughputInfoResultPropertiesResource"] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, value: Optional[List["_models.NotebookWorkspace"]] = None, **kwargs: Any) -> None: """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :keyword resource: properties of physical partition throughput info. - :paramtype resource: - ~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResultPropertiesResource + :keyword value: Array of notebook workspace resources. + :paramtype value: list[~azure.mgmt.cosmosdb.models.NotebookWorkspace] """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.resource = resource - - -class PhysicalPartitionThroughputInfoResultPropertiesResource( - PhysicalPartitionThroughputInfoProperties -): # pylint: disable=name-too-long - """properties of physical partition throughput info. - - :ivar physical_partition_throughput_info: Array of physical partition throughput info objects. - :vartype physical_partition_throughput_info: - list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource] - """ - + super().__init__(**kwargs) + self.value = value -class PrivateEndpointConnection(ProxyResource): - """A private endpoint connection. - Variables are only populated by the server, and will be ignored when sending a request. +class Operation(_serialization.Model): + """REST API operation. - :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. + :ivar name: Operation name: {provider}/{resource}/{operation}. :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.cosmosdb.models.SystemData - :ivar private_endpoint: Private endpoint which the connection belongs to. - :vartype private_endpoint: ~azure.mgmt.cosmosdb.models.PrivateEndpointProperty - :ivar private_link_service_connection_state: Connection State of the Private Endpoint - Connection. - :vartype private_link_service_connection_state: - ~azure.mgmt.cosmosdb.models.PrivateLinkServiceConnectionStateProperty - :ivar group_id: Group id of the private endpoint. - :vartype group_id: str - :ivar provisioning_state: Provisioning state of the private endpoint. - :vartype provisioning_state: str + :ivar display: The object that represents the operation. + :vartype display: ~azure.mgmt.cosmosdb.models.OperationDisplay """ - _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"}, - "private_endpoint": {"key": "properties.privateEndpoint", "type": "PrivateEndpointProperty"}, - "private_link_service_connection_state": { - "key": "properties.privateLinkServiceConnectionState", - "type": "PrivateLinkServiceConnectionStateProperty", - }, - "group_id": {"key": "properties.groupId", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "display": {"key": "display", "type": "OperationDisplay"}, } def __init__( - self, - *, - private_endpoint: Optional["_models.PrivateEndpointProperty"] = None, - private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionStateProperty"] = None, - group_id: Optional[str] = None, - provisioning_state: Optional[str] = None, - **kwargs: Any + self, *, name: Optional[str] = None, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any ) -> None: """ - :keyword private_endpoint: Private endpoint which the connection belongs to. - :paramtype private_endpoint: ~azure.mgmt.cosmosdb.models.PrivateEndpointProperty - :keyword private_link_service_connection_state: Connection State of the Private Endpoint - Connection. - :paramtype private_link_service_connection_state: - ~azure.mgmt.cosmosdb.models.PrivateLinkServiceConnectionStateProperty - :keyword group_id: Group id of the private endpoint. - :paramtype group_id: str - :keyword provisioning_state: Provisioning state of the private endpoint. - :paramtype provisioning_state: str + :keyword name: Operation name: {provider}/{resource}/{operation}. + :paramtype name: str + :keyword display: The object that represents the operation. + :paramtype display: ~azure.mgmt.cosmosdb.models.OperationDisplay """ super().__init__(**kwargs) - self.private_endpoint = private_endpoint - self.private_link_service_connection_state = private_link_service_connection_state - self.group_id = group_id - self.provisioning_state = provisioning_state + self.name = name + self.display = display -class PrivateEndpointConnectionListResult(_serialization.Model): - """A list of private endpoint connections. +class OperationDisplay(_serialization.Model): + """The object that represents the operation. - :ivar value: Array of private endpoint connections. - :vartype value: list[~azure.mgmt.cosmosdb.models.PrivateEndpointConnection] + :ivar provider: Service provider: Microsoft.ResourceProvider. + :vartype provider: str + :ivar resource: Resource on which the operation is performed: Profile, endpoint, etc. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + :ivar description: Description of operation. + :vartype description: str """ _attribute_map = { - "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, + "provider": {"key": "Provider", "type": "str"}, + "resource": {"key": "Resource", "type": "str"}, + "operation": {"key": "Operation", "type": "str"}, + "description": {"key": "Description", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnection"]] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs: Any + ) -> None: """ - :keyword value: Array of private endpoint connections. - :paramtype value: list[~azure.mgmt.cosmosdb.models.PrivateEndpointConnection] + :keyword provider: Service provider: Microsoft.ResourceProvider. + :paramtype provider: str + :keyword resource: Resource on which the operation is performed: Profile, endpoint, etc. + :paramtype resource: str + :keyword operation: Operation type: Read, write, delete, etc. + :paramtype operation: str + :keyword description: Description of operation. + :paramtype description: str """ super().__init__(**kwargs) - self.value = value + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description -class PrivateEndpointProperty(_serialization.Model): - """Private endpoint which the connection belongs to. +class OperationListResult(_serialization.Model): + """Result of the request to list Resource Provider operations. It contains a list of operations + and a URL link to get the next set of results. - :ivar id: Resource id of the private endpoint. - :vartype id: str + :ivar value: List of operations supported by the Resource Provider. + :vartype value: list[~azure.mgmt.cosmosdb.models.Operation] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str """ _attribute_map = { - "id": {"key": "id", "type": "str"}, + "value": {"key": "value", "type": "[Operation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + def __init__( + self, *, value: Optional[List["_models.Operation"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ - :keyword id: Resource id of the private endpoint. - :paramtype id: str + :keyword value: List of operations supported by the Resource Provider. + :paramtype value: list[~azure.mgmt.cosmosdb.models.Operation] + :keyword next_link: URL to get the next set of operation list results if there are any. + :paramtype next_link: str """ super().__init__(**kwargs) - self.id = id + self.value = value + self.next_link = next_link -class PrivateLinkResource(ARMProxyResource): - """A private link resource. +class PartitionMetric(Metric): + """The metric values for a single partition. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The unique resource identifier of the database account. - :vartype id: str - :ivar name: The name of the database account. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar group_id: The private link resource group id. - :vartype group_id: str - :ivar required_members: The private link resource required member names. - :vartype required_members: list[str] - :ivar required_zone_names: The private link resource required zone names. - :vartype required_zone_names: list[str] + :ivar start_time: The start time for the metric (ISO-8601 format). + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time for the metric (ISO-8601 format). + :vartype end_time: ~datetime.datetime + :ivar time_grain: The time grain to be used to summarize the metric values. + :vartype time_grain: str + :ivar unit: The unit of the metric. Known values are: "Count", "Bytes", "Seconds", "Percent", + "CountPerSecond", "BytesPerSecond", and "Milliseconds". + :vartype unit: str or ~azure.mgmt.cosmosdb.models.UnitType + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cosmosdb.models.MetricName + :ivar metric_values: The metric values for the specified time window and timestep. + :vartype metric_values: list[~azure.mgmt.cosmosdb.models.MetricValue] + :ivar partition_id: The partition id (GUID identifier) of the metric values. + :vartype partition_id: str + :ivar partition_key_range_id: The partition key range id (integer identifier) of the metric + values. + :vartype partition_key_range_id: str """ _validation = { - "id": {"readonly": True}, + "start_time": {"readonly": True}, + "end_time": {"readonly": True}, + "time_grain": {"readonly": True}, + "unit": {"readonly": True}, "name": {"readonly": True}, - "type": {"readonly": True}, - "group_id": {"readonly": True}, - "required_members": {"readonly": True}, - "required_zone_names": {"readonly": True}, + "metric_values": {"readonly": True}, + "partition_id": {"readonly": True}, + "partition_key_range_id": {"readonly": True}, } _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "group_id": {"key": "properties.groupId", "type": "str"}, - "required_members": {"key": "properties.requiredMembers", "type": "[str]"}, - "required_zone_names": {"key": "properties.requiredZoneNames", "type": "[str]"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "time_grain": {"key": "timeGrain", "type": "str"}, + "unit": {"key": "unit", "type": "str"}, + "name": {"key": "name", "type": "MetricName"}, + "metric_values": {"key": "metricValues", "type": "[MetricValue]"}, + "partition_id": {"key": "partitionId", "type": "str"}, + "partition_key_range_id": {"key": "partitionKeyRangeId", "type": "str"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.group_id = None - self.required_members = None - self.required_zone_names = None + self.partition_id = None + self.partition_key_range_id = None -class PrivateLinkResourceListResult(_serialization.Model): - """A list of private link resources. +class PartitionMetricListResult(_serialization.Model): + """The response to a list partition metrics request. - :ivar value: Array of private link resources. - :vartype value: list[~azure.mgmt.cosmosdb.models.PrivateLinkResource] + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of partition-level metrics for the account. + :vartype value: list[~azure.mgmt.cosmosdb.models.PartitionMetric] """ + _validation = { + "value": {"readonly": True}, + } + _attribute_map = { - "value": {"key": "value", "type": "[PrivateLinkResource]"}, + "value": {"key": "value", "type": "[PartitionMetric]"}, } - def __init__(self, *, value: Optional[List["_models.PrivateLinkResource"]] = None, **kwargs: Any) -> None: - """ - :keyword value: Array of private link resources. - :paramtype value: list[~azure.mgmt.cosmosdb.models.PrivateLinkResource] - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.value = value + self.value = None -class PrivateLinkServiceConnectionStateProperty(_serialization.Model): # pylint: disable=name-too-long - """Connection State of the Private Endpoint Connection. +class Usage(_serialization.Model): + """The usage data for a usage request. Variables are only populated by the server, and will be ignored when sending a request. - :ivar status: The private link service connection status. - :vartype status: str - :ivar description: The private link service connection description. - :vartype description: str - :ivar actions_required: Any action that is required beyond basic workflow (approve/ reject/ - disconnect). - :vartype actions_required: str + :ivar unit: The unit of the metric. Known values are: "Count", "Bytes", "Seconds", "Percent", + "CountPerSecond", "BytesPerSecond", and "Milliseconds". + :vartype unit: str or ~azure.mgmt.cosmosdb.models.UnitType + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cosmosdb.models.MetricName + :ivar quota_period: The quota period used to summarize the usage values. + :vartype quota_period: str + :ivar limit: Maximum value for this metric. + :vartype limit: int + :ivar current_value: Current value for this metric. + :vartype current_value: int """ _validation = { - "actions_required": {"readonly": True}, + "unit": {"readonly": True}, + "name": {"readonly": True}, + "quota_period": {"readonly": True}, + "limit": {"readonly": True}, + "current_value": {"readonly": True}, } _attribute_map = { - "status": {"key": "status", "type": "str"}, - "description": {"key": "description", "type": "str"}, - "actions_required": {"key": "actionsRequired", "type": "str"}, + "unit": {"key": "unit", "type": "str"}, + "name": {"key": "name", "type": "MetricName"}, + "quota_period": {"key": "quotaPeriod", "type": "str"}, + "limit": {"key": "limit", "type": "int"}, + "current_value": {"key": "currentValue", "type": "int"}, } - def __init__(self, *, status: Optional[str] = None, description: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword status: The private link service connection status. - :paramtype status: str - :keyword description: The private link service connection description. - :paramtype description: str - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.status = status - self.description = description - self.actions_required = None - - -class Privilege(_serialization.Model): - """The set of data plane operations permitted through this Role Definition. - - :ivar resource: An Azure Cosmos DB Mongo DB Resource. - :vartype resource: ~azure.mgmt.cosmosdb.models.PrivilegeResource - :ivar actions: An array of actions that are allowed. - :vartype actions: list[str] - """ - - _attribute_map = { - "resource": {"key": "resource", "type": "PrivilegeResource"}, - "actions": {"key": "actions", "type": "[str]"}, - } + self.unit = None + self.name = None + self.quota_period = None + self.limit = None + self.current_value = None - def __init__( - self, - *, - resource: Optional["_models.PrivilegeResource"] = None, - actions: Optional[List[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword resource: An Azure Cosmos DB Mongo DB Resource. - :paramtype resource: ~azure.mgmt.cosmosdb.models.PrivilegeResource - :keyword actions: An array of actions that are allowed. - :paramtype actions: list[str] - """ - super().__init__(**kwargs) - self.resource = resource - self.actions = actions +class PartitionUsage(Usage): + """The partition level usage data for a usage request. -class PrivilegeResource(_serialization.Model): - """An Azure Cosmos DB Mongo DB Resource. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar db: The database name the role is applied. - :vartype db: str - :ivar collection: The collection name the role is applied. - :vartype collection: str + :ivar unit: The unit of the metric. Known values are: "Count", "Bytes", "Seconds", "Percent", + "CountPerSecond", "BytesPerSecond", and "Milliseconds". + :vartype unit: str or ~azure.mgmt.cosmosdb.models.UnitType + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cosmosdb.models.MetricName + :ivar quota_period: The quota period used to summarize the usage values. + :vartype quota_period: str + :ivar limit: Maximum value for this metric. + :vartype limit: int + :ivar current_value: Current value for this metric. + :vartype current_value: int + :ivar partition_id: The partition id (GUID identifier) of the usages. + :vartype partition_id: str + :ivar partition_key_range_id: The partition key range id (integer identifier) of the usages. + :vartype partition_key_range_id: str """ + _validation = { + "unit": {"readonly": True}, + "name": {"readonly": True}, + "quota_period": {"readonly": True}, + "limit": {"readonly": True}, + "current_value": {"readonly": True}, + "partition_id": {"readonly": True}, + "partition_key_range_id": {"readonly": True}, + } + _attribute_map = { - "db": {"key": "db", "type": "str"}, - "collection": {"key": "collection", "type": "str"}, + "unit": {"key": "unit", "type": "str"}, + "name": {"key": "name", "type": "MetricName"}, + "quota_period": {"key": "quotaPeriod", "type": "str"}, + "limit": {"key": "limit", "type": "int"}, + "current_value": {"key": "currentValue", "type": "int"}, + "partition_id": {"key": "partitionId", "type": "str"}, + "partition_key_range_id": {"key": "partitionKeyRangeId", "type": "str"}, } - def __init__(self, *, db: Optional[str] = None, collection: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword db: The database name the role is applied. - :paramtype db: str - :keyword collection: The collection name the role is applied. - :paramtype collection: str - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.db = db - self.collection = collection + self.partition_id = None + self.partition_key_range_id = None -class ProvisioningIssue(_serialization.Model): - """Describes a provisioning issue for a network security perimeter configuration. +class PartitionUsagesResult(_serialization.Model): + """The response to a list partition level usage request. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: Name of the issue. - :vartype name: str - :ivar properties: Details of a provisioning issue for a network security perimeter (NSP) - configuration. Resource providers should generate separate provisioning issue elements for each - separate issue detected, and include a meaningful and distinctive description, as well as any - appropriate suggestedResourceIds and suggestedAccessRules. - :vartype properties: ~azure.mgmt.cosmosdb.models.ProvisioningIssueProperties + :ivar value: The list of partition-level usages for the database. A usage is a point in time + metric. + :vartype value: list[~azure.mgmt.cosmosdb.models.PartitionUsage] """ _validation = { - "name": {"readonly": True}, - "properties": {"readonly": True}, + "value": {"readonly": True}, } _attribute_map = { - "name": {"key": "name", "type": "str"}, - "properties": {"key": "properties", "type": "ProvisioningIssueProperties"}, + "value": {"key": "value", "type": "[PartitionUsage]"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.name = None - self.properties = None + self.value = None -class ProvisioningIssueProperties(_serialization.Model): - """Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource - providers should generate separate provisioning issue elements for each separate issue - detected, and include a meaningful and distinctive description, as well as any appropriate - suggestedResourceIds and suggestedAccessRules. +class PercentileMetric(_serialization.Model): + """Percentile Metric data. Variables are only populated by the server, and will be ignored when sending a request. - :ivar issue_type: Type of issue. Known values are: "Unknown", - "ConfigurationPropagationFailure", "MissingPerimeterConfiguration", and - "MissingIdentityConfiguration". - :vartype issue_type: str or ~azure.mgmt.cosmosdb.models.IssueType - :ivar severity: Severity of the issue. Known values are: "Warning" and "Error". - :vartype severity: str or ~azure.mgmt.cosmosdb.models.Severity - :ivar description: Description of the issue. - :vartype description: str - :ivar suggested_resource_ids: Fully qualified resource IDs of suggested resources that can be - associated to the network security perimeter (NSP) to remediate the issue. - :vartype suggested_resource_ids: list[str] - :ivar suggested_access_rules: Access rules that can be added to the network security profile - (NSP) to remediate the issue. - :vartype suggested_access_rules: list[~azure.mgmt.cosmosdb.models.AccessRule] + :ivar start_time: The start time for the metric (ISO-8601 format). + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time for the metric (ISO-8601 format). + :vartype end_time: ~datetime.datetime + :ivar time_grain: The time grain to be used to summarize the metric values. + :vartype time_grain: str + :ivar unit: The unit of the metric. Known values are: "Count", "Bytes", "Seconds", "Percent", + "CountPerSecond", "BytesPerSecond", and "Milliseconds". + :vartype unit: str or ~azure.mgmt.cosmosdb.models.UnitType + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cosmosdb.models.MetricName + :ivar metric_values: The percentile metric values for the specified time window and timestep. + :vartype metric_values: list[~azure.mgmt.cosmosdb.models.PercentileMetricValue] """ _validation = { - "issue_type": {"readonly": True}, - "severity": {"readonly": True}, - "description": {"readonly": True}, - "suggested_resource_ids": {"readonly": True}, - "suggested_access_rules": {"readonly": True}, + "start_time": {"readonly": True}, + "end_time": {"readonly": True}, + "time_grain": {"readonly": True}, + "unit": {"readonly": True}, + "name": {"readonly": True}, + "metric_values": {"readonly": True}, } _attribute_map = { - "issue_type": {"key": "issueType", "type": "str"}, - "severity": {"key": "severity", "type": "str"}, - "description": {"key": "description", "type": "str"}, - "suggested_resource_ids": {"key": "suggestedResourceIds", "type": "[str]"}, - "suggested_access_rules": {"key": "suggestedAccessRules", "type": "[AccessRule]"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "time_grain": {"key": "timeGrain", "type": "str"}, + "unit": {"key": "unit", "type": "str"}, + "name": {"key": "name", "type": "MetricName"}, + "metric_values": {"key": "metricValues", "type": "[PercentileMetricValue]"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.issue_type = None - self.severity = None - self.description = None - self.suggested_resource_ids = None - self.suggested_access_rules = None + self.start_time = None + self.end_time = None + self.time_grain = None + self.unit = None + self.name = None + self.metric_values = None -class RedistributeThroughputParameters(ARMResourceProperties): - """Cosmos DB redistribute throughput parameters object. +class PercentileMetricListResult(_serialization.Model): + """The response to a list percentile metrics request. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to server. - - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar location: The location of the resource group to which the resource belongs. - :vartype location: str - :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :ivar resource: The standard JSON format of a resource throughput. Required. - :vartype resource: ~azure.mgmt.cosmosdb.models.RedistributeThroughputPropertiesResource + :ivar value: The list of percentile metrics for the account. + :vartype value: list[~azure.mgmt.cosmosdb.models.PercentileMetric] """ _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "resource": {"required": True}, + "value": {"readonly": True}, } _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "resource": {"key": "properties.resource", "type": "RedistributeThroughputPropertiesResource"}, + "value": {"key": "value", "type": "[PercentileMetric]"}, } - def __init__( - self, - *, - resource: "_models.RedistributeThroughputPropertiesResource", - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :keyword resource: The standard JSON format of a resource throughput. Required. - :paramtype resource: ~azure.mgmt.cosmosdb.models.RedistributeThroughputPropertiesResource - """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.resource = resource + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None -class RedistributeThroughputPropertiesResource(_serialization.Model): - """Resource to redistribute throughput for Azure Cosmos DB resource. +class PercentileMetricValue(MetricValue): + """Represents percentile metrics values. - All required parameters must be populated in order to send to server. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar throughput_policy: ThroughputPolicy to apply for throughput redistribution. Required. - Known values are: "none", "equal", and "custom". - :vartype throughput_policy: str or ~azure.mgmt.cosmosdb.models.ThroughputPolicyType - :ivar target_physical_partition_throughput_info: Array of - PhysicalPartitionThroughputInfoResource objects. Required. - :vartype target_physical_partition_throughput_info: - list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource] - :ivar source_physical_partition_throughput_info: Array of - PhysicalPartitionThroughputInfoResource objects. Required. - :vartype source_physical_partition_throughput_info: - list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource] + :ivar count: The number of values for the metric. + :vartype count: int + :ivar average: The average value of the metric. + :vartype average: float + :ivar maximum: The max value of the metric. + :vartype maximum: float + :ivar minimum: The min value of the metric. + :vartype minimum: float + :ivar timestamp: The metric timestamp (ISO-8601 format). + :vartype timestamp: ~datetime.datetime + :ivar total: The total value of the metric. + :vartype total: float + :ivar p10: The 10th percentile value for the metric. + :vartype p10: float + :ivar p25: The 25th percentile value for the metric. + :vartype p25: float + :ivar p50: The 50th percentile value for the metric. + :vartype p50: float + :ivar p75: The 75th percentile value for the metric. + :vartype p75: float + :ivar p90: The 90th percentile value for the metric. + :vartype p90: float + :ivar p95: The 95th percentile value for the metric. + :vartype p95: float + :ivar p99: The 99th percentile value for the metric. + :vartype p99: float """ _validation = { - "throughput_policy": {"required": True}, - "target_physical_partition_throughput_info": {"required": True}, - "source_physical_partition_throughput_info": {"required": True}, + "count": {"readonly": True}, + "average": {"readonly": True}, + "maximum": {"readonly": True}, + "minimum": {"readonly": True}, + "timestamp": {"readonly": True}, + "total": {"readonly": True}, + "p10": {"readonly": True}, + "p25": {"readonly": True}, + "p50": {"readonly": True}, + "p75": {"readonly": True}, + "p90": {"readonly": True}, + "p95": {"readonly": True}, + "p99": {"readonly": True}, } _attribute_map = { - "throughput_policy": {"key": "throughputPolicy", "type": "str"}, - "target_physical_partition_throughput_info": { - "key": "targetPhysicalPartitionThroughputInfo", - "type": "[PhysicalPartitionThroughputInfoResource]", - }, - "source_physical_partition_throughput_info": { - "key": "sourcePhysicalPartitionThroughputInfo", - "type": "[PhysicalPartitionThroughputInfoResource]", - }, + "count": {"key": "_count", "type": "int"}, + "average": {"key": "average", "type": "float"}, + "maximum": {"key": "maximum", "type": "float"}, + "minimum": {"key": "minimum", "type": "float"}, + "timestamp": {"key": "timestamp", "type": "iso-8601"}, + "total": {"key": "total", "type": "float"}, + "p10": {"key": "P10", "type": "float"}, + "p25": {"key": "P25", "type": "float"}, + "p50": {"key": "P50", "type": "float"}, + "p75": {"key": "P75", "type": "float"}, + "p90": {"key": "P90", "type": "float"}, + "p95": {"key": "P95", "type": "float"}, + "p99": {"key": "P99", "type": "float"}, } - def __init__( - self, - *, - throughput_policy: Union[str, "_models.ThroughputPolicyType"], - target_physical_partition_throughput_info: List["_models.PhysicalPartitionThroughputInfoResource"], - source_physical_partition_throughput_info: List["_models.PhysicalPartitionThroughputInfoResource"], - **kwargs: Any - ) -> None: - """ - :keyword throughput_policy: ThroughputPolicy to apply for throughput redistribution. Required. - Known values are: "none", "equal", and "custom". - :paramtype throughput_policy: str or ~azure.mgmt.cosmosdb.models.ThroughputPolicyType - :keyword target_physical_partition_throughput_info: Array of - PhysicalPartitionThroughputInfoResource objects. Required. - :paramtype target_physical_partition_throughput_info: - list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource] - :keyword source_physical_partition_throughput_info: Array of - PhysicalPartitionThroughputInfoResource objects. Required. - :paramtype source_physical_partition_throughput_info: - list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource] - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.throughput_policy = throughput_policy - self.target_physical_partition_throughput_info = target_physical_partition_throughput_info - self.source_physical_partition_throughput_info = source_physical_partition_throughput_info + self.p10 = None + self.p25 = None + self.p50 = None + self.p75 = None + self.p90 = None + self.p95 = None + self.p99 = None -class RegionForOnlineOffline(_serialization.Model): - """Cosmos DB region to online or offline. +class PeriodicModeBackupPolicy(BackupPolicy): + """The object representing periodic mode backup policy. All required parameters must be populated in order to send to server. - :ivar region: Cosmos DB region, with spaces between words and each word capitalized. Required. - :vartype region: str + :ivar type: Describes the mode of backups. Required. Known values are: "Periodic" and + "Continuous". + :vartype type: str or ~azure.mgmt.cosmosdb.models.BackupPolicyType + :ivar migration_state: The object representing the state of the migration between the backup + policies. + :vartype migration_state: ~azure.mgmt.cosmosdb.models.BackupPolicyMigrationState + :ivar periodic_mode_properties: Configuration values for periodic mode backup. + :vartype periodic_mode_properties: ~azure.mgmt.cosmosdb.models.PeriodicModeProperties """ _validation = { - "region": {"required": True}, + "type": {"required": True}, } _attribute_map = { - "region": {"key": "region", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "migration_state": {"key": "migrationState", "type": "BackupPolicyMigrationState"}, + "periodic_mode_properties": {"key": "periodicModeProperties", "type": "PeriodicModeProperties"}, } - def __init__(self, *, region: str, **kwargs: Any) -> None: - """ - :keyword region: Cosmos DB region, with spaces between words and each word capitalized. - Required. - :paramtype region: str + def __init__( + self, + *, + migration_state: Optional["_models.BackupPolicyMigrationState"] = None, + periodic_mode_properties: Optional["_models.PeriodicModeProperties"] = None, + **kwargs: Any + ) -> None: """ - super().__init__(**kwargs) - self.region = region + :keyword migration_state: The object representing the state of the migration between the backup + policies. + :paramtype migration_state: ~azure.mgmt.cosmosdb.models.BackupPolicyMigrationState + :keyword periodic_mode_properties: Configuration values for periodic mode backup. + :paramtype periodic_mode_properties: ~azure.mgmt.cosmosdb.models.PeriodicModeProperties + """ + super().__init__(migration_state=migration_state, **kwargs) + self.type: str = "Periodic" + self.periodic_mode_properties = periodic_mode_properties -class ResourceAssociation(_serialization.Model): - """Information about resource association. +class PeriodicModeProperties(_serialization.Model): + """Configuration values for periodic mode backup. - :ivar name: Name of the resource association. - :vartype name: str - :ivar access_mode: Access mode of the resource association. Known values are: "Enforced", - "Learning", and "Audit". - :vartype access_mode: str or ~azure.mgmt.cosmosdb.models.ResourceAssociationAccessMode + :ivar backup_interval_in_minutes: An integer representing the interval in minutes between two + backups. + :vartype backup_interval_in_minutes: int + :ivar backup_retention_interval_in_hours: An integer representing the time (in hours) that each + backup is retained. + :vartype backup_retention_interval_in_hours: int + :ivar backup_storage_redundancy: Enum to indicate type of backup residency. Known values are: + "Geo", "Local", and "Zone". + :vartype backup_storage_redundancy: str or ~azure.mgmt.cosmosdb.models.BackupStorageRedundancy """ + _validation = { + "backup_interval_in_minutes": {"minimum": 0}, + "backup_retention_interval_in_hours": {"minimum": 0}, + } + _attribute_map = { - "name": {"key": "name", "type": "str"}, - "access_mode": {"key": "accessMode", "type": "str"}, + "backup_interval_in_minutes": {"key": "backupIntervalInMinutes", "type": "int"}, + "backup_retention_interval_in_hours": {"key": "backupRetentionIntervalInHours", "type": "int"}, + "backup_storage_redundancy": {"key": "backupStorageRedundancy", "type": "str"}, } def __init__( self, *, - name: Optional[str] = None, - access_mode: Optional[Union[str, "_models.ResourceAssociationAccessMode"]] = None, + backup_interval_in_minutes: Optional[int] = None, + backup_retention_interval_in_hours: Optional[int] = None, + backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = None, **kwargs: Any ) -> None: """ - :keyword name: Name of the resource association. - :paramtype name: str - :keyword access_mode: Access mode of the resource association. Known values are: "Enforced", - "Learning", and "Audit". - :paramtype access_mode: str or ~azure.mgmt.cosmosdb.models.ResourceAssociationAccessMode + :keyword backup_interval_in_minutes: An integer representing the interval in minutes between + two backups. + :paramtype backup_interval_in_minutes: int + :keyword backup_retention_interval_in_hours: An integer representing the time (in hours) that + each backup is retained. + :paramtype backup_retention_interval_in_hours: int + :keyword backup_storage_redundancy: Enum to indicate type of backup residency. Known values + are: "Geo", "Local", and "Zone". + :paramtype backup_storage_redundancy: str or + ~azure.mgmt.cosmosdb.models.BackupStorageRedundancy """ super().__init__(**kwargs) - self.name = name - self.access_mode = access_mode + self.backup_interval_in_minutes = backup_interval_in_minutes + self.backup_retention_interval_in_hours = backup_retention_interval_in_hours + self.backup_storage_redundancy = backup_storage_redundancy -class RestoreParametersBase(_serialization.Model): - """Parameters to indicate the information about the restore. +class Permission(_serialization.Model): + """The set of data plane operations permitted through this Role Definition. - :ivar restore_source: The id of the restorable database account from which the restore has to - be initiated. For example: - /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}. # pylint: disable=line-too-long - :vartype restore_source: str - :ivar restore_timestamp_in_utc: Time to which the account has to be restored (ISO-8601 format). - :vartype restore_timestamp_in_utc: ~datetime.datetime - :ivar restore_with_ttl_disabled: Specifies whether the restored account will have Time-To-Live - disabled upon the successful restore. - :vartype restore_with_ttl_disabled: bool + :ivar data_actions: An array of data actions that are allowed. + :vartype data_actions: list[str] + :ivar not_data_actions: An array of data actions that are denied. + :vartype not_data_actions: list[str] """ _attribute_map = { - "restore_source": {"key": "restoreSource", "type": "str"}, - "restore_timestamp_in_utc": {"key": "restoreTimestampInUtc", "type": "iso-8601"}, - "restore_with_ttl_disabled": {"key": "restoreWithTtlDisabled", "type": "bool"}, + "data_actions": {"key": "dataActions", "type": "[str]"}, + "not_data_actions": {"key": "notDataActions", "type": "[str]"}, } def __init__( - self, - *, - restore_source: Optional[str] = None, - restore_timestamp_in_utc: Optional[datetime.datetime] = None, - restore_with_ttl_disabled: Optional[bool] = None, - **kwargs: Any + self, *, data_actions: Optional[List[str]] = None, not_data_actions: Optional[List[str]] = None, **kwargs: Any ) -> None: """ - :keyword restore_source: The id of the restorable database account from which the restore has - to be initiated. For example: - /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}. # pylint: disable=line-too-long - :paramtype restore_source: str - :keyword restore_timestamp_in_utc: Time to which the account has to be restored (ISO-8601 - format). - :paramtype restore_timestamp_in_utc: ~datetime.datetime - :keyword restore_with_ttl_disabled: Specifies whether the restored account will have - Time-To-Live disabled upon the successful restore. - :paramtype restore_with_ttl_disabled: bool + :keyword data_actions: An array of data actions that are allowed. + :paramtype data_actions: list[str] + :keyword not_data_actions: An array of data actions that are denied. + :paramtype not_data_actions: list[str] """ super().__init__(**kwargs) - self.restore_source = restore_source - self.restore_timestamp_in_utc = restore_timestamp_in_utc - self.restore_with_ttl_disabled = restore_with_ttl_disabled - - -class ResourceRestoreParameters(RestoreParametersBase): - """Parameters to indicate the information about the restore. - - :ivar restore_source: The id of the restorable database account from which the restore has to - be initiated. For example: - /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}. # pylint: disable=line-too-long - :vartype restore_source: str - :ivar restore_timestamp_in_utc: Time to which the account has to be restored (ISO-8601 format). - :vartype restore_timestamp_in_utc: ~datetime.datetime - :ivar restore_with_ttl_disabled: Specifies whether the restored account will have Time-To-Live - disabled upon the successful restore. - :vartype restore_with_ttl_disabled: bool - """ + self.data_actions = data_actions + self.not_data_actions = not_data_actions -class RestorableDatabaseAccountGetResult(_serialization.Model): - """A Azure Cosmos DB restorable database account. +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: The unique resource identifier of the ARM resource. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str - :ivar name: The name of the ARM resource. + :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of Azure resource. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar location: The location of the resource group to which the resource belongs. - :vartype location: str - :ivar account_name: The name of the global database account. - :vartype account_name: str - :ivar creation_time: The creation time of the restorable database account (ISO-8601 format). - :vartype creation_time: ~datetime.datetime - :ivar oldest_restorable_time: The least recent time at which the database account can be - restored to (ISO-8601 format). - :vartype oldest_restorable_time: ~datetime.datetime - :ivar deletion_time: The time at which the restorable database account has been deleted - (ISO-8601 format). - :vartype deletion_time: ~datetime.datetime - :ivar api_type: The API type of the restorable database account. Known values are: "MongoDB", - "Gremlin", "Cassandra", "Table", "Sql", and "GremlinV2". - :vartype api_type: str or ~azure.mgmt.cosmosdb.models.ApiType - :ivar restorable_locations: List of regions where the of the database account can be restored - from. - :vartype restorable_locations: list[~azure.mgmt.cosmosdb.models.RestorableLocationResource] """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, - "api_type": {"readonly": True}, - "restorable_locations": {"readonly": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "account_name": {"key": "properties.accountName", "type": "str"}, - "creation_time": {"key": "properties.creationTime", "type": "iso-8601"}, - "oldest_restorable_time": {"key": "properties.oldestRestorableTime", "type": "iso-8601"}, - "deletion_time": {"key": "properties.deletionTime", "type": "iso-8601"}, - "api_type": {"key": "properties.apiType", "type": "str"}, - "restorable_locations": {"key": "properties.restorableLocations", "type": "[RestorableLocationResource]"}, } - def __init__( - self, - *, - location: Optional[str] = None, - account_name: Optional[str] = None, - creation_time: Optional[datetime.datetime] = None, - oldest_restorable_time: Optional[datetime.datetime] = None, - deletion_time: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword account_name: The name of the global database account. - :paramtype account_name: str - :keyword creation_time: The creation time of the restorable database account (ISO-8601 format). - :paramtype creation_time: ~datetime.datetime - :keyword oldest_restorable_time: The least recent time at which the database account can be - restored to (ISO-8601 format). - :paramtype oldest_restorable_time: ~datetime.datetime - :keyword deletion_time: The time at which the restorable database account has been deleted - (ISO-8601 format). - :paramtype deletion_time: ~datetime.datetime - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.account_name = account_name - self.creation_time = creation_time - self.oldest_restorable_time = oldest_restorable_time - self.deletion_time = deletion_time - self.api_type = None - self.restorable_locations = None -class RestorableDatabaseAccountsListResult(_serialization.Model): - """The List operation response, that contains the restorable database accounts and their - 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 value: List of restorable database accounts and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.RestorableDatabaseAccountGetResult] + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str """ - _validation = { - "value": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[RestorableDatabaseAccountGetResult]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - -class RestorableGremlinDatabaseGetResult(_serialization.Model): - """An Azure Cosmos DB Gremlin database event. +class PrivateEndpointConnection(ProxyResource): + """A private endpoint connection. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The unique resource Identifier of the ARM resource. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str - :ivar name: The name of the ARM resource. + :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of Azure resource. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar resource: The resource of an Azure Cosmos DB Gremlin database event. - :vartype resource: ~azure.mgmt.cosmosdb.models.RestorableGremlinDatabasePropertiesResource + :ivar private_endpoint: Private endpoint which the connection belongs to. + :vartype private_endpoint: ~azure.mgmt.cosmosdb.models.PrivateEndpointProperty + :ivar private_link_service_connection_state: Connection State of the Private Endpoint + Connection. + :vartype private_link_service_connection_state: + ~azure.mgmt.cosmosdb.models.PrivateLinkServiceConnectionStateProperty + :ivar group_id: Group id of the private endpoint. + :vartype group_id: str + :ivar provisioning_state: Provisioning state of the private endpoint. + :vartype provisioning_state: str """ _validation = { @@ -11910,438 +8698,428 @@ class RestorableGremlinDatabaseGetResult(_serialization.Model): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "resource": {"key": "properties.resource", "type": "RestorableGremlinDatabasePropertiesResource"}, + "private_endpoint": {"key": "properties.privateEndpoint", "type": "PrivateEndpointProperty"}, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionStateProperty", + }, + "group_id": {"key": "properties.groupId", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, } def __init__( - self, *, resource: Optional["_models.RestorableGremlinDatabasePropertiesResource"] = None, **kwargs: Any + self, + *, + private_endpoint: Optional["_models.PrivateEndpointProperty"] = None, + private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionStateProperty"] = None, + group_id: Optional[str] = None, + provisioning_state: Optional[str] = None, + **kwargs: Any ) -> None: """ - :keyword resource: The resource of an Azure Cosmos DB Gremlin database event. - :paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableGremlinDatabasePropertiesResource + :keyword private_endpoint: Private endpoint which the connection belongs to. + :paramtype private_endpoint: ~azure.mgmt.cosmosdb.models.PrivateEndpointProperty + :keyword private_link_service_connection_state: Connection State of the Private Endpoint + Connection. + :paramtype private_link_service_connection_state: + ~azure.mgmt.cosmosdb.models.PrivateLinkServiceConnectionStateProperty + :keyword group_id: Group id of the private endpoint. + :paramtype group_id: str + :keyword provisioning_state: Provisioning state of the private endpoint. + :paramtype provisioning_state: str """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.resource = resource - + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.group_id = group_id + self.provisioning_state = provisioning_state -class RestorableGremlinDatabasePropertiesResource(_serialization.Model): # pylint: disable=name-too-long - """The resource of an Azure Cosmos DB Gremlin database event. - Variables are only populated by the server, and will be ignored when sending a request. +class PrivateEndpointConnectionListResult(_serialization.Model): + """A list of private endpoint connections. - :ivar rid: A system generated property. A unique identifier. - :vartype rid: str - :ivar operation_type: The operation type of this database event. Known values are: "Create", - "Replace", "Delete", "Recreate", and "SystemOperation". - :vartype operation_type: str or ~azure.mgmt.cosmosdb.models.OperationType - :ivar can_undelete: A state of this database to identify if this database is restorable in same - account. - :vartype can_undelete: str - :ivar can_undelete_reason: The reason why this database can not be restored in same account. - :vartype can_undelete_reason: str - :ivar event_timestamp: The time when this database event happened. - :vartype event_timestamp: str - :ivar owner_id: The name of this Gremlin database. - :vartype owner_id: str - :ivar owner_resource_id: The resource ID of this Gremlin database. - :vartype owner_resource_id: str + :ivar value: Array of private endpoint connections. + :vartype value: list[~azure.mgmt.cosmosdb.models.PrivateEndpointConnection] """ - _validation = { - "rid": {"readonly": True}, - "operation_type": {"readonly": True}, - "can_undelete": {"readonly": True}, - "can_undelete_reason": {"readonly": True}, - "event_timestamp": {"readonly": True}, - "owner_id": {"readonly": True}, - "owner_resource_id": {"readonly": True}, - } - _attribute_map = { - "rid": {"key": "_rid", "type": "str"}, - "operation_type": {"key": "operationType", "type": "str"}, - "can_undelete": {"key": "canUndelete", "type": "str"}, - "can_undelete_reason": {"key": "canUndeleteReason", "type": "str"}, - "event_timestamp": {"key": "eventTimestamp", "type": "str"}, - "owner_id": {"key": "ownerId", "type": "str"}, - "owner_resource_id": {"key": "ownerResourceId", "type": "str"}, + "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnection"]] = None, **kwargs: Any) -> None: + """ + :keyword value: Array of private endpoint connections. + :paramtype value: list[~azure.mgmt.cosmosdb.models.PrivateEndpointConnection] + """ super().__init__(**kwargs) - self.rid = None - self.operation_type = None - self.can_undelete = None - self.can_undelete_reason = None - self.event_timestamp = None - self.owner_id = None - self.owner_resource_id = None - + self.value = value -class RestorableGremlinDatabasesListResult(_serialization.Model): - """The List operation response, that contains the Gremlin database events and their properties. - Variables are only populated by the server, and will be ignored when sending a request. +class PrivateEndpointProperty(_serialization.Model): + """Private endpoint which the connection belongs to. - :ivar value: List of Gremlin database events and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.RestorableGremlinDatabaseGetResult] + :ivar id: Resource id of the private endpoint. + :vartype id: str """ - _validation = { - "value": {"readonly": True}, - } - _attribute_map = { - "value": {"key": "value", "type": "[RestorableGremlinDatabaseGetResult]"}, + "id": {"key": "id", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + """ + :keyword id: Resource id of the private endpoint. + :paramtype id: str + """ super().__init__(**kwargs) - self.value = None + self.id = id -class RestorableGremlinGraphGetResult(_serialization.Model): - """An Azure Cosmos DB Gremlin graph event. +class PrivateLinkResource(ARMProxyResource): + """A private link resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The unique resource Identifier of the ARM resource. + :ivar id: The unique resource identifier of the database account. :vartype id: str - :ivar name: The name of the ARM resource. + :ivar name: The name of the database account. :vartype name: str :ivar type: The type of Azure resource. :vartype type: str - :ivar resource: The resource of an Azure Cosmos DB Gremlin graph event. - :vartype resource: ~azure.mgmt.cosmosdb.models.RestorableGremlinGraphPropertiesResource + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :ivar required_zone_names: The private link resource required zone names. + :vartype required_zone_names: list[str] """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "group_id": {"readonly": True}, + "required_members": {"readonly": True}, + "required_zone_names": {"readonly": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "resource": {"key": "properties.resource", "type": "RestorableGremlinGraphPropertiesResource"}, + "group_id": {"key": "properties.groupId", "type": "str"}, + "required_members": {"key": "properties.requiredMembers", "type": "[str]"}, + "required_zone_names": {"key": "properties.requiredZoneNames", "type": "[str]"}, } - def __init__( - self, *, resource: Optional["_models.RestorableGremlinGraphPropertiesResource"] = None, **kwargs: Any - ) -> None: + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = None + + +class PrivateLinkResourceListResult(_serialization.Model): + """A list of private link resources. + + :ivar value: Array of private link resources. + :vartype value: list[~azure.mgmt.cosmosdb.models.PrivateLinkResource] + """ + + _attribute_map = { + "value": {"key": "value", "type": "[PrivateLinkResource]"}, + } + + def __init__(self, *, value: Optional[List["_models.PrivateLinkResource"]] = None, **kwargs: Any) -> None: """ - :keyword resource: The resource of an Azure Cosmos DB Gremlin graph event. - :paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableGremlinGraphPropertiesResource + :keyword value: Array of private link resources. + :paramtype value: list[~azure.mgmt.cosmosdb.models.PrivateLinkResource] """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.resource = resource + self.value = value -class RestorableGremlinGraphPropertiesResource(_serialization.Model): - """The resource of an Azure Cosmos DB Gremlin graph event. +class PrivateLinkServiceConnectionStateProperty(_serialization.Model): # pylint: disable=name-too-long + """Connection State of the Private Endpoint Connection. Variables are only populated by the server, and will be ignored when sending a request. - :ivar rid: A system generated property. A unique identifier. - :vartype rid: str - :ivar operation_type: The operation type of this graph event. Known values are: "Create", - "Replace", "Delete", "Recreate", and "SystemOperation". - :vartype operation_type: str or ~azure.mgmt.cosmosdb.models.OperationType - :ivar can_undelete: A state of this graph to identify if this graph is restorable in same - account. - :vartype can_undelete: str - :ivar can_undelete_reason: The reason why this graph can not be restored in same account. - :vartype can_undelete_reason: str - :ivar event_timestamp: The time when this graph event happened. - :vartype event_timestamp: str - :ivar owner_id: The name of this Gremlin graph. - :vartype owner_id: str - :ivar owner_resource_id: The resource ID of this Gremlin graph. - :vartype owner_resource_id: str + :ivar status: The private link service connection status. + :vartype status: str + :ivar description: The private link service connection description. + :vartype description: str + :ivar actions_required: Any action that is required beyond basic workflow (approve/ reject/ + disconnect). + :vartype actions_required: str """ _validation = { - "rid": {"readonly": True}, - "operation_type": {"readonly": True}, - "can_undelete": {"readonly": True}, - "can_undelete_reason": {"readonly": True}, - "event_timestamp": {"readonly": True}, - "owner_id": {"readonly": True}, - "owner_resource_id": {"readonly": True}, + "actions_required": {"readonly": True}, } _attribute_map = { - "rid": {"key": "_rid", "type": "str"}, - "operation_type": {"key": "operationType", "type": "str"}, - "can_undelete": {"key": "canUndelete", "type": "str"}, - "can_undelete_reason": {"key": "canUndeleteReason", "type": "str"}, - "event_timestamp": {"key": "eventTimestamp", "type": "str"}, - "owner_id": {"key": "ownerId", "type": "str"}, - "owner_resource_id": {"key": "ownerResourceId", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "actions_required": {"key": "actionsRequired", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, status: Optional[str] = None, description: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword status: The private link service connection status. + :paramtype status: str + :keyword description: The private link service connection description. + :paramtype description: str + """ super().__init__(**kwargs) - self.rid = None - self.operation_type = None - self.can_undelete = None - self.can_undelete_reason = None - self.event_timestamp = None - self.owner_id = None - self.owner_resource_id = None - + self.status = status + self.description = description + self.actions_required = None -class RestorableGremlinGraphsListResult(_serialization.Model): - """The List operation response, that contains the Gremlin graph events and their properties. - Variables are only populated by the server, and will be ignored when sending a request. +class Privilege(_serialization.Model): + """The set of data plane operations permitted through this Role Definition. - :ivar value: List of Gremlin graph events and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.RestorableGremlinGraphGetResult] + :ivar resource: An Azure Cosmos DB Mongo DB Resource. + :vartype resource: ~azure.mgmt.cosmosdb.models.PrivilegeResource + :ivar actions: An array of actions that are allowed. + :vartype actions: list[str] """ - _validation = { - "value": {"readonly": True}, - } - _attribute_map = { - "value": {"key": "value", "type": "[RestorableGremlinGraphGetResult]"}, + "resource": {"key": "resource", "type": "PrivilegeResource"}, + "actions": {"key": "actions", "type": "[str]"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + resource: Optional["_models.PrivilegeResource"] = None, + actions: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword resource: An Azure Cosmos DB Mongo DB Resource. + :paramtype resource: ~azure.mgmt.cosmosdb.models.PrivilegeResource + :keyword actions: An array of actions that are allowed. + :paramtype actions: list[str] + """ super().__init__(**kwargs) - self.value = None - + self.resource = resource + self.actions = actions -class RestorableGremlinResourcesGetResult(_serialization.Model): - """Specific Databases to restore. - Variables are only populated by the server, and will be ignored when sending a request. +class PrivilegeResource(_serialization.Model): + """An Azure Cosmos DB Mongo DB Resource. - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar database_name: The name of the gremlin database available for restore. - :vartype database_name: str - :ivar graph_names: The names of the graphs available for restore. - :vartype graph_names: list[str] + :ivar db: The database name the role is applied. + :vartype db: str + :ivar collection: The collection name the role is applied. + :vartype collection: str """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - } - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "database_name": {"key": "databaseName", "type": "str"}, - "graph_names": {"key": "graphNames", "type": "[str]"}, + "db": {"key": "db", "type": "str"}, + "collection": {"key": "collection", "type": "str"}, } - def __init__( - self, *, database_name: Optional[str] = None, graph_names: Optional[List[str]] = None, **kwargs: Any - ) -> None: + def __init__(self, *, db: Optional[str] = None, collection: Optional[str] = None, **kwargs: Any) -> None: """ - :keyword database_name: The name of the gremlin database available for restore. - :paramtype database_name: str - :keyword graph_names: The names of the graphs available for restore. - :paramtype graph_names: list[str] + :keyword db: The database name the role is applied. + :paramtype db: str + :keyword collection: The collection name the role is applied. + :paramtype collection: str """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.database_name = database_name - self.graph_names = graph_names + self.db = db + self.collection = collection -class RestorableGremlinResourcesListResult(_serialization.Model): - """The List operation response, that contains the restorable Gremlin resources. +class RegionForOnlineOffline(_serialization.Model): + """Cosmos DB region to online or offline. - 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 value: List of restorable Gremlin resources, including the gremlin database and graph - names. - :vartype value: list[~azure.mgmt.cosmosdb.models.RestorableGremlinResourcesGetResult] + :ivar region: Cosmos DB region, with spaces between words and each word capitalized. Required. + :vartype region: str """ _validation = { - "value": {"readonly": True}, + "region": {"required": True}, } _attribute_map = { - "value": {"key": "value", "type": "[RestorableGremlinResourcesGetResult]"}, + "region": {"key": "region", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, region: str, **kwargs: Any) -> None: + """ + :keyword region: Cosmos DB region, with spaces between words and each word capitalized. + Required. + :paramtype region: str + """ super().__init__(**kwargs) - self.value = None - + self.region = region -class RestorableLocationResource(_serialization.Model): - """Properties of the regional restorable account. - Variables are only populated by the server, and will be ignored when sending a request. +class RestoreParametersBase(_serialization.Model): + """Parameters to indicate the information about the restore. - :ivar location_name: The location of the regional restorable account. - :vartype location_name: str - :ivar regional_database_account_instance_id: The instance id of the regional restorable - account. - :vartype regional_database_account_instance_id: str - :ivar creation_time: The creation time of the regional restorable database account (ISO-8601 - format). - :vartype creation_time: ~datetime.datetime - :ivar deletion_time: The time at which the regional restorable database account has been - deleted (ISO-8601 format). - :vartype deletion_time: ~datetime.datetime + :ivar restore_source: The id of the restorable database account from which the restore has to + be initiated. For example: + /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}. # pylint: disable=line-too-long + :vartype restore_source: str + :ivar restore_timestamp_in_utc: Time to which the account has to be restored (ISO-8601 format). + :vartype restore_timestamp_in_utc: ~datetime.datetime + :ivar restore_with_ttl_disabled: Specifies whether the restored account will have Time-To-Live + disabled upon the successful restore. + :vartype restore_with_ttl_disabled: bool """ - _validation = { - "location_name": {"readonly": True}, - "regional_database_account_instance_id": {"readonly": True}, - "creation_time": {"readonly": True}, - "deletion_time": {"readonly": True}, - } - _attribute_map = { - "location_name": {"key": "locationName", "type": "str"}, - "regional_database_account_instance_id": {"key": "regionalDatabaseAccountInstanceId", "type": "str"}, - "creation_time": {"key": "creationTime", "type": "iso-8601"}, - "deletion_time": {"key": "deletionTime", "type": "iso-8601"}, + "restore_source": {"key": "restoreSource", "type": "str"}, + "restore_timestamp_in_utc": {"key": "restoreTimestampInUtc", "type": "iso-8601"}, + "restore_with_ttl_disabled": {"key": "restoreWithTtlDisabled", "type": "bool"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + restore_source: Optional[str] = None, + restore_timestamp_in_utc: Optional[datetime.datetime] = None, + restore_with_ttl_disabled: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword restore_source: The id of the restorable database account from which the restore has + to be initiated. For example: + /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}. # pylint: disable=line-too-long + :paramtype restore_source: str + :keyword restore_timestamp_in_utc: Time to which the account has to be restored (ISO-8601 + format). + :paramtype restore_timestamp_in_utc: ~datetime.datetime + :keyword restore_with_ttl_disabled: Specifies whether the restored account will have + Time-To-Live disabled upon the successful restore. + :paramtype restore_with_ttl_disabled: bool + """ super().__init__(**kwargs) - self.location_name = None - self.regional_database_account_instance_id = None - self.creation_time = None - self.deletion_time = None + self.restore_source = restore_source + self.restore_timestamp_in_utc = restore_timestamp_in_utc + self.restore_with_ttl_disabled = restore_with_ttl_disabled -class RestorableMongodbCollectionGetResult(_serialization.Model): - """An Azure Cosmos DB MongoDB collection event. +class ResourceRestoreParameters(RestoreParametersBase): + """Parameters to indicate the information about the restore. + + :ivar restore_source: The id of the restorable database account from which the restore has to + be initiated. For example: + /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}. # pylint: disable=line-too-long + :vartype restore_source: str + :ivar restore_timestamp_in_utc: Time to which the account has to be restored (ISO-8601 format). + :vartype restore_timestamp_in_utc: ~datetime.datetime + :ivar restore_with_ttl_disabled: Specifies whether the restored account will have Time-To-Live + disabled upon the successful restore. + :vartype restore_with_ttl_disabled: bool + """ + + +class RestorableDatabaseAccountGetResult(_serialization.Model): + """A Azure Cosmos DB restorable database account. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The unique resource Identifier of the ARM resource. + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str :ivar name: The name of the ARM resource. :vartype name: str :ivar type: The type of Azure resource. :vartype type: str - :ivar resource: The resource of an Azure Cosmos DB MongoDB collection event. - :vartype resource: ~azure.mgmt.cosmosdb.models.RestorableMongodbCollectionPropertiesResource + :ivar location: The location of the resource group to which the resource belongs. + :vartype location: str + :ivar account_name: The name of the global database account. + :vartype account_name: str + :ivar creation_time: The creation time of the restorable database account (ISO-8601 format). + :vartype creation_time: ~datetime.datetime + :ivar deletion_time: The time at which the restorable database account has been deleted + (ISO-8601 format). + :vartype deletion_time: ~datetime.datetime + :ivar oldest_restorable_time: The least recent time at which the database account can be + restored to (ISO-8601 format). + :vartype oldest_restorable_time: ~datetime.datetime + :ivar api_type: The API type of the restorable database account. Known values are: "MongoDB", + "Gremlin", "Cassandra", "Table", "Sql", and "GremlinV2". + :vartype api_type: str or ~azure.mgmt.cosmosdb.models.ApiType + :ivar restorable_locations: List of regions where the of the database account can be restored + from. + :vartype restorable_locations: list[~azure.mgmt.cosmosdb.models.RestorableLocationResource] """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "api_type": {"readonly": True}, + "restorable_locations": {"readonly": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "resource": {"key": "properties.resource", "type": "RestorableMongodbCollectionPropertiesResource"}, + "location": {"key": "location", "type": "str"}, + "account_name": {"key": "properties.accountName", "type": "str"}, + "creation_time": {"key": "properties.creationTime", "type": "iso-8601"}, + "deletion_time": {"key": "properties.deletionTime", "type": "iso-8601"}, + "oldest_restorable_time": {"key": "properties.oldestRestorableTime", "type": "iso-8601"}, + "api_type": {"key": "properties.apiType", "type": "str"}, + "restorable_locations": {"key": "properties.restorableLocations", "type": "[RestorableLocationResource]"}, } def __init__( - self, *, resource: Optional["_models.RestorableMongodbCollectionPropertiesResource"] = None, **kwargs: Any - ) -> None: - """ - :keyword resource: The resource of an Azure Cosmos DB MongoDB collection event. - :paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableMongodbCollectionPropertiesResource - """ - super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.resource = resource - - -class RestorableMongodbCollectionPropertiesResource(_serialization.Model): # pylint: disable=name-too-long - """The resource of an Azure Cosmos DB MongoDB collection event. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar rid: A system generated property. A unique identifier. - :vartype rid: str - :ivar operation_type: The operation type of this collection event. Known values are: "Create", - "Replace", "Delete", "Recreate", and "SystemOperation". - :vartype operation_type: str or ~azure.mgmt.cosmosdb.models.OperationType - :ivar can_undelete: A state of this collection to identify if this container is restorable in - same account. - :vartype can_undelete: str - :ivar can_undelete_reason: The reason why this collection can not be restored in same account. - :vartype can_undelete_reason: str - :ivar event_timestamp: The time when this collection event happened. - :vartype event_timestamp: str - :ivar owner_id: The name of this MongoDB collection. - :vartype owner_id: str - :ivar owner_resource_id: The resource ID of this MongoDB collection. - :vartype owner_resource_id: str - """ - - _validation = { - "rid": {"readonly": True}, - "operation_type": {"readonly": True}, - "can_undelete": {"readonly": True}, - "can_undelete_reason": {"readonly": True}, - "event_timestamp": {"readonly": True}, - "owner_id": {"readonly": True}, - "owner_resource_id": {"readonly": True}, - } - - _attribute_map = { - "rid": {"key": "_rid", "type": "str"}, - "operation_type": {"key": "operationType", "type": "str"}, - "can_undelete": {"key": "canUndelete", "type": "str"}, - "can_undelete_reason": {"key": "canUndeleteReason", "type": "str"}, - "event_timestamp": {"key": "eventTimestamp", "type": "str"}, - "owner_id": {"key": "ownerId", "type": "str"}, - "owner_resource_id": {"key": "ownerResourceId", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ + self, + *, + location: Optional[str] = None, + account_name: Optional[str] = None, + creation_time: Optional[datetime.datetime] = None, + deletion_time: Optional[datetime.datetime] = None, + oldest_restorable_time: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: + """ + :keyword location: The location of the resource group to which the resource belongs. + :paramtype location: str + :keyword account_name: The name of the global database account. + :paramtype account_name: str + :keyword creation_time: The creation time of the restorable database account (ISO-8601 format). + :paramtype creation_time: ~datetime.datetime + :keyword deletion_time: The time at which the restorable database account has been deleted + (ISO-8601 format). + :paramtype deletion_time: ~datetime.datetime + :keyword oldest_restorable_time: The least recent time at which the database account can be + restored to (ISO-8601 format). + :paramtype oldest_restorable_time: ~datetime.datetime + """ super().__init__(**kwargs) - self.rid = None - self.operation_type = None - self.can_undelete = None - self.can_undelete_reason = None - self.event_timestamp = None - self.owner_id = None - self.owner_resource_id = None + self.id = None + self.name = None + self.type = None + self.location = location + self.account_name = account_name + self.creation_time = creation_time + self.deletion_time = deletion_time + self.oldest_restorable_time = oldest_restorable_time + self.api_type = None + self.restorable_locations = None -class RestorableMongodbCollectionsListResult(_serialization.Model): - """The List operation response, that contains the MongoDB collection events and their properties. +class RestorableDatabaseAccountsListResult(_serialization.Model): + """The List operation response, that contains the restorable database accounts and their + properties. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of MongoDB collection events and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.RestorableMongodbCollectionGetResult] + :ivar value: List of restorable database accounts and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.RestorableDatabaseAccountGetResult] """ _validation = { @@ -12349,7 +9127,7 @@ class RestorableMongodbCollectionsListResult(_serialization.Model): } _attribute_map = { - "value": {"key": "value", "type": "[RestorableMongodbCollectionGetResult]"}, + "value": {"key": "value", "type": "[RestorableDatabaseAccountGetResult]"}, } def __init__(self, **kwargs: Any) -> None: @@ -12358,8 +9136,8 @@ def __init__(self, **kwargs: Any) -> None: self.value = None -class RestorableMongodbDatabaseGetResult(_serialization.Model): - """An Azure Cosmos DB MongoDB database event. +class RestorableGremlinDatabaseGetResult(_serialization.Model): + """An Azure Cosmos DB Gremlin database event. Variables are only populated by the server, and will be ignored when sending a request. @@ -12369,8 +9147,8 @@ class RestorableMongodbDatabaseGetResult(_serialization.Model): :vartype name: str :ivar type: The type of Azure resource. :vartype type: str - :ivar resource: The resource of an Azure Cosmos DB MongoDB database event. - :vartype resource: ~azure.mgmt.cosmosdb.models.RestorableMongodbDatabasePropertiesResource + :ivar resource: The resource of an Azure Cosmos DB Gremlin database event. + :vartype resource: ~azure.mgmt.cosmosdb.models.RestorableGremlinDatabasePropertiesResource """ _validation = { @@ -12383,15 +9161,15 @@ class RestorableMongodbDatabaseGetResult(_serialization.Model): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "resource": {"key": "properties.resource", "type": "RestorableMongodbDatabasePropertiesResource"}, + "resource": {"key": "properties.resource", "type": "RestorableGremlinDatabasePropertiesResource"}, } def __init__( - self, *, resource: Optional["_models.RestorableMongodbDatabasePropertiesResource"] = None, **kwargs: Any + self, *, resource: Optional["_models.RestorableGremlinDatabasePropertiesResource"] = None, **kwargs: Any ) -> None: """ - :keyword resource: The resource of an Azure Cosmos DB MongoDB database event. - :paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableMongodbDatabasePropertiesResource + :keyword resource: The resource of an Azure Cosmos DB Gremlin database event. + :paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableGremlinDatabasePropertiesResource """ super().__init__(**kwargs) self.id = None @@ -12400,8 +9178,8 @@ def __init__( self.resource = resource -class RestorableMongodbDatabasePropertiesResource(_serialization.Model): # pylint: disable=name-too-long - """The resource of an Azure Cosmos DB MongoDB database event. +class RestorableGremlinDatabasePropertiesResource(_serialization.Model): # pylint: disable=name-too-long + """The resource of an Azure Cosmos DB Gremlin database event. Variables are only populated by the server, and will be ignored when sending a request. @@ -12417,9 +9195,9 @@ class RestorableMongodbDatabasePropertiesResource(_serialization.Model): # pyli :vartype can_undelete_reason: str :ivar event_timestamp: The time when this database event happened. :vartype event_timestamp: str - :ivar owner_id: The name of this MongoDB database. + :ivar owner_id: The name of this Gremlin database. :vartype owner_id: str - :ivar owner_resource_id: The resource ID of this MongoDB database. + :ivar owner_resource_id: The resource ID of this Gremlin database. :vartype owner_resource_id: str """ @@ -12455,84 +9233,13 @@ def __init__(self, **kwargs: Any) -> None: self.owner_resource_id = None -class RestorableMongodbDatabasesListResult(_serialization.Model): - """The List operation response, that contains the MongoDB database events and their properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of MongoDB database events and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.RestorableMongodbDatabaseGetResult] - """ - - _validation = { - "value": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[RestorableMongodbDatabaseGetResult]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - - -class RestorableMongodbResourcesGetResult(_serialization.Model): - """Specific Databases to restore. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar database_name: The name of the database available for restore. - :vartype database_name: str - :ivar collection_names: The names of the collections available for restore. - :vartype collection_names: list[str] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "database_name": {"key": "databaseName", "type": "str"}, - "collection_names": {"key": "collectionNames", "type": "[str]"}, - } - - def __init__( - self, *, database_name: Optional[str] = None, collection_names: Optional[List[str]] = None, **kwargs: Any - ) -> None: - """ - :keyword database_name: The name of the database available for restore. - :paramtype database_name: str - :keyword collection_names: The names of the collections available for restore. - :paramtype collection_names: list[str] - """ - super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.database_name = database_name - self.collection_names = collection_names - - -class RestorableMongodbResourcesListResult(_serialization.Model): - """The List operation response, that contains the restorable MongoDB resources. +class RestorableGremlinDatabasesListResult(_serialization.Model): + """The List operation response, that contains the Gremlin database events and their properties. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of restorable MongoDB resources, including the database and collection names. - :vartype value: list[~azure.mgmt.cosmosdb.models.RestorableMongodbResourcesGetResult] + :ivar value: List of Gremlin database events and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.RestorableGremlinDatabaseGetResult] """ _validation = { @@ -12540,7 +9247,7 @@ class RestorableMongodbResourcesListResult(_serialization.Model): } _attribute_map = { - "value": {"key": "value", "type": "[RestorableMongodbResourcesGetResult]"}, + "value": {"key": "value", "type": "[RestorableGremlinDatabaseGetResult]"}, } def __init__(self, **kwargs: Any) -> None: @@ -12549,8 +9256,8 @@ def __init__(self, **kwargs: Any) -> None: self.value = None -class RestorableSqlContainerGetResult(_serialization.Model): - """An Azure Cosmos DB SQL container event. +class RestorableGremlinGraphGetResult(_serialization.Model): + """An Azure Cosmos DB Gremlin graph event. Variables are only populated by the server, and will be ignored when sending a request. @@ -12560,8 +9267,8 @@ class RestorableSqlContainerGetResult(_serialization.Model): :vartype name: str :ivar type: The type of Azure resource. :vartype type: str - :ivar resource: The resource of an Azure Cosmos DB SQL container event. - :vartype resource: ~azure.mgmt.cosmosdb.models.RestorableSqlContainerPropertiesResource + :ivar resource: The resource of an Azure Cosmos DB Gremlin graph event. + :vartype resource: ~azure.mgmt.cosmosdb.models.RestorableGremlinGraphPropertiesResource """ _validation = { @@ -12574,15 +9281,15 @@ class RestorableSqlContainerGetResult(_serialization.Model): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "resource": {"key": "properties.resource", "type": "RestorableSqlContainerPropertiesResource"}, + "resource": {"key": "properties.resource", "type": "RestorableGremlinGraphPropertiesResource"}, } def __init__( - self, *, resource: Optional["_models.RestorableSqlContainerPropertiesResource"] = None, **kwargs: Any + self, *, resource: Optional["_models.RestorableGremlinGraphPropertiesResource"] = None, **kwargs: Any ) -> None: """ - :keyword resource: The resource of an Azure Cosmos DB SQL container event. - :paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableSqlContainerPropertiesResource + :keyword resource: The resource of an Azure Cosmos DB Gremlin graph event. + :paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableGremlinGraphPropertiesResource """ super().__init__(**kwargs) self.id = None @@ -12591,30 +9298,27 @@ def __init__( self.resource = resource -class RestorableSqlContainerPropertiesResource(_serialization.Model): - """The resource of an Azure Cosmos DB SQL container event. +class RestorableGremlinGraphPropertiesResource(_serialization.Model): + """The resource of an Azure Cosmos DB Gremlin graph event. Variables are only populated by the server, and will be ignored when sending a request. :ivar rid: A system generated property. A unique identifier. :vartype rid: str - :ivar operation_type: The operation type of this container event. Known values are: "Create", + :ivar operation_type: The operation type of this graph event. Known values are: "Create", "Replace", "Delete", "Recreate", and "SystemOperation". :vartype operation_type: str or ~azure.mgmt.cosmosdb.models.OperationType - :ivar can_undelete: A state of this container to identify if this container is restorable in - same account. + :ivar can_undelete: A state of this graph to identify if this graph is restorable in same + account. :vartype can_undelete: str - :ivar can_undelete_reason: The reason why this container can not be restored in same account. + :ivar can_undelete_reason: The reason why this graph can not be restored in same account. :vartype can_undelete_reason: str - :ivar event_timestamp: The when this container event happened. + :ivar event_timestamp: The time when this graph event happened. :vartype event_timestamp: str - :ivar owner_id: The name of this SQL container. + :ivar owner_id: The name of this Gremlin graph. :vartype owner_id: str - :ivar owner_resource_id: The resource ID of this SQL container. + :ivar owner_resource_id: The resource ID of this Gremlin graph. :vartype owner_resource_id: str - :ivar container: Cosmos DB SQL container resource object. - :vartype container: - ~azure.mgmt.cosmosdb.models.RestorableSqlContainerPropertiesResourceContainer """ _validation = { @@ -12635,17 +9339,10 @@ class RestorableSqlContainerPropertiesResource(_serialization.Model): "event_timestamp": {"key": "eventTimestamp", "type": "str"}, "owner_id": {"key": "ownerId", "type": "str"}, "owner_resource_id": {"key": "ownerResourceId", "type": "str"}, - "container": {"key": "container", "type": "RestorableSqlContainerPropertiesResourceContainer"}, } - def __init__( - self, *, container: Optional["_models.RestorableSqlContainerPropertiesResourceContainer"] = None, **kwargs: Any - ) -> None: - """ - :keyword container: Cosmos DB SQL container resource object. - :paramtype container: - ~azure.mgmt.cosmosdb.models.RestorableSqlContainerPropertiesResourceContainer - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) self.rid = None self.operation_type = None @@ -12654,325 +9351,146 @@ def __init__( self.event_timestamp = None self.owner_id = None self.owner_resource_id = None - self.container = container -class SqlContainerResource(_serialization.Model): - """Cosmos DB SQL container resource object. +class RestorableGremlinGraphsListResult(_serialization.Model): + """The List operation response, that contains the Gremlin graph events and their properties. - All required parameters must be populated in order to send to server. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Name of the Cosmos DB SQL container. Required. + :ivar value: List of Gremlin graph events and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.RestorableGremlinGraphGetResult] + """ + + _validation = { + "value": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[RestorableGremlinGraphGetResult]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None + + +class RestorableGremlinResourcesGetResult(_serialization.Model): + """Specific Databases to restore. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str - :ivar indexing_policy: The configuration of the indexing policy. By default, the indexing is - automatic for all document paths within the container. - :vartype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy - :ivar partition_key: The configuration of the partition key to be used for partitioning data - into multiple partitions. - :vartype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey - :ivar default_ttl: Default time to live. - :vartype default_ttl: int - :ivar unique_key_policy: The unique key policy configuration for specifying uniqueness - constraints on documents in the collection in the Azure Cosmos DB service. - :vartype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy - :ivar conflict_resolution_policy: The conflict resolution policy for the container. - :vartype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy - :ivar client_encryption_policy: The client encryption policy for the container. - :vartype client_encryption_policy: ~azure.mgmt.cosmosdb.models.ClientEncryptionPolicy - :ivar analytical_storage_ttl: Analytical TTL. - :vartype analytical_storage_ttl: int - :ivar restore_parameters: Parameters to indicate the information about the restore. - :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" - and "Restore". - :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode - :ivar materialized_view_definition: The configuration for defining Materialized Views. This - must be specified only for creating a Materialized View container. - :vartype materialized_view_definition: ~azure.mgmt.cosmosdb.models.MaterializedViewDefinition - :ivar computed_properties: List of computed properties. - :vartype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty] - :ivar vector_embedding_policy: The vector embedding policy for the container. - :vartype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy + :ivar name: The name of the ARM resource. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :ivar database_name: The name of the gremlin database available for restore. + :vartype database_name: str + :ivar graph_names: The names of the graphs available for restore. + :vartype graph_names: list[str] """ _validation = { - "id": {"required": True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, - "indexing_policy": {"key": "indexingPolicy", "type": "IndexingPolicy"}, - "partition_key": {"key": "partitionKey", "type": "ContainerPartitionKey"}, - "default_ttl": {"key": "defaultTtl", "type": "int"}, - "unique_key_policy": {"key": "uniqueKeyPolicy", "type": "UniqueKeyPolicy"}, - "conflict_resolution_policy": {"key": "conflictResolutionPolicy", "type": "ConflictResolutionPolicy"}, - "client_encryption_policy": {"key": "clientEncryptionPolicy", "type": "ClientEncryptionPolicy"}, - "analytical_storage_ttl": {"key": "analyticalStorageTtl", "type": "int"}, - "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, - "create_mode": {"key": "createMode", "type": "str"}, - "materialized_view_definition": {"key": "materializedViewDefinition", "type": "MaterializedViewDefinition"}, - "computed_properties": {"key": "computedProperties", "type": "[ComputedProperty]"}, - "vector_embedding_policy": {"key": "vectorEmbeddingPolicy", "type": "VectorEmbeddingPolicy"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "database_name": {"key": "databaseName", "type": "str"}, + "graph_names": {"key": "graphNames", "type": "[str]"}, } def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - indexing_policy: Optional["_models.IndexingPolicy"] = None, - partition_key: Optional["_models.ContainerPartitionKey"] = None, - default_ttl: Optional[int] = None, - unique_key_policy: Optional["_models.UniqueKeyPolicy"] = None, - conflict_resolution_policy: Optional["_models.ConflictResolutionPolicy"] = None, - client_encryption_policy: Optional["_models.ClientEncryptionPolicy"] = None, - analytical_storage_ttl: Optional[int] = None, - restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, - create_mode: Union[str, "_models.CreateMode"] = "Default", - materialized_view_definition: Optional["_models.MaterializedViewDefinition"] = None, - computed_properties: Optional[List["_models.ComputedProperty"]] = None, - vector_embedding_policy: Optional["_models.VectorEmbeddingPolicy"] = None, - **kwargs: Any + self, *, database_name: Optional[str] = None, graph_names: Optional[List[str]] = None, **kwargs: Any ) -> None: """ - :keyword id: Name of the Cosmos DB SQL container. Required. - :paramtype id: str - :keyword indexing_policy: The configuration of the indexing policy. By default, the indexing is - automatic for all document paths within the container. - :paramtype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy - :keyword partition_key: The configuration of the partition key to be used for partitioning data - into multiple partitions. - :paramtype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey - :keyword default_ttl: Default time to live. - :paramtype default_ttl: int - :keyword unique_key_policy: The unique key policy configuration for specifying uniqueness - constraints on documents in the collection in the Azure Cosmos DB service. - :paramtype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy - :keyword conflict_resolution_policy: The conflict resolution policy for the container. - :paramtype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy - :keyword client_encryption_policy: The client encryption policy for the container. - :paramtype client_encryption_policy: ~azure.mgmt.cosmosdb.models.ClientEncryptionPolicy - :keyword analytical_storage_ttl: Analytical TTL. - :paramtype analytical_storage_ttl: int - :keyword restore_parameters: Parameters to indicate the information about the restore. - :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: - "Default" and "Restore". - :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode - :keyword materialized_view_definition: The configuration for defining Materialized Views. This - must be specified only for creating a Materialized View container. - :paramtype materialized_view_definition: ~azure.mgmt.cosmosdb.models.MaterializedViewDefinition - :keyword computed_properties: List of computed properties. - :paramtype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty] - :keyword vector_embedding_policy: The vector embedding policy for the container. - :paramtype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy + :keyword database_name: The name of the gremlin database available for restore. + :paramtype database_name: str + :keyword graph_names: The names of the graphs available for restore. + :paramtype graph_names: list[str] """ super().__init__(**kwargs) - self.id = id - self.indexing_policy = indexing_policy - self.partition_key = partition_key - self.default_ttl = default_ttl - self.unique_key_policy = unique_key_policy - self.conflict_resolution_policy = conflict_resolution_policy - self.client_encryption_policy = client_encryption_policy - self.analytical_storage_ttl = analytical_storage_ttl - self.restore_parameters = restore_parameters - self.create_mode = create_mode - self.materialized_view_definition = materialized_view_definition - self.computed_properties = computed_properties - self.vector_embedding_policy = vector_embedding_policy + self.id = None + self.name = None + self.type = None + self.database_name = database_name + self.graph_names = graph_names -class RestorableSqlContainerPropertiesResourceContainer( - SqlContainerResource, ExtendedResourceProperties -): # pylint: disable=name-too-long - """Cosmos DB SQL container resource object. +class RestorableGremlinResourcesListResult(_serialization.Model): + """The List operation response, that contains the restorable Gremlin resources. 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 rid: A system generated property. A unique identifier. - :vartype rid: str - :ivar ts: A system generated property that denotes the last updated timestamp of the resource. - :vartype ts: float - :ivar etag: A system generated property representing the resource etag required for optimistic - concurrency control. - :vartype etag: str - :ivar id: Name of the Cosmos DB SQL container. Required. - :vartype id: str - :ivar indexing_policy: The configuration of the indexing policy. By default, the indexing is - automatic for all document paths within the container. - :vartype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy - :ivar partition_key: The configuration of the partition key to be used for partitioning data - into multiple partitions. - :vartype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey - :ivar default_ttl: Default time to live. - :vartype default_ttl: int - :ivar unique_key_policy: The unique key policy configuration for specifying uniqueness - constraints on documents in the collection in the Azure Cosmos DB service. - :vartype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy - :ivar conflict_resolution_policy: The conflict resolution policy for the container. - :vartype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy - :ivar client_encryption_policy: The client encryption policy for the container. - :vartype client_encryption_policy: ~azure.mgmt.cosmosdb.models.ClientEncryptionPolicy - :ivar analytical_storage_ttl: Analytical TTL. - :vartype analytical_storage_ttl: int - :ivar restore_parameters: Parameters to indicate the information about the restore. - :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" - and "Restore". - :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode - :ivar materialized_view_definition: The configuration for defining Materialized Views. This - must be specified only for creating a Materialized View container. - :vartype materialized_view_definition: ~azure.mgmt.cosmosdb.models.MaterializedViewDefinition - :ivar computed_properties: List of computed properties. - :vartype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty] - :ivar vector_embedding_policy: The vector embedding policy for the container. - :vartype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy - :ivar self_property: A system generated property that specifies the addressable path of the - container resource. - :vartype self_property: str + :ivar value: List of restorable Gremlin resources, including the gremlin database and graph + names. + :vartype value: list[~azure.mgmt.cosmosdb.models.RestorableGremlinResourcesGetResult] """ _validation = { - "rid": {"readonly": True}, - "ts": {"readonly": True}, - "etag": {"readonly": True}, - "id": {"required": True}, - "self_property": {"readonly": True}, + "value": {"readonly": True}, } _attribute_map = { - "rid": {"key": "_rid", "type": "str"}, - "ts": {"key": "_ts", "type": "float"}, - "etag": {"key": "_etag", "type": "str"}, - "id": {"key": "id", "type": "str"}, - "indexing_policy": {"key": "indexingPolicy", "type": "IndexingPolicy"}, - "partition_key": {"key": "partitionKey", "type": "ContainerPartitionKey"}, - "default_ttl": {"key": "defaultTtl", "type": "int"}, - "unique_key_policy": {"key": "uniqueKeyPolicy", "type": "UniqueKeyPolicy"}, - "conflict_resolution_policy": {"key": "conflictResolutionPolicy", "type": "ConflictResolutionPolicy"}, - "client_encryption_policy": {"key": "clientEncryptionPolicy", "type": "ClientEncryptionPolicy"}, - "analytical_storage_ttl": {"key": "analyticalStorageTtl", "type": "int"}, - "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, - "create_mode": {"key": "createMode", "type": "str"}, - "materialized_view_definition": {"key": "materializedViewDefinition", "type": "MaterializedViewDefinition"}, - "computed_properties": {"key": "computedProperties", "type": "[ComputedProperty]"}, - "vector_embedding_policy": {"key": "vectorEmbeddingPolicy", "type": "VectorEmbeddingPolicy"}, - "self_property": {"key": "_self", "type": "str"}, + "value": {"key": "value", "type": "[RestorableGremlinResourcesGetResult]"}, } - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - indexing_policy: Optional["_models.IndexingPolicy"] = None, - partition_key: Optional["_models.ContainerPartitionKey"] = None, - default_ttl: Optional[int] = None, - unique_key_policy: Optional["_models.UniqueKeyPolicy"] = None, - conflict_resolution_policy: Optional["_models.ConflictResolutionPolicy"] = None, - client_encryption_policy: Optional["_models.ClientEncryptionPolicy"] = None, - analytical_storage_ttl: Optional[int] = None, - restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, - create_mode: Union[str, "_models.CreateMode"] = "Default", - materialized_view_definition: Optional["_models.MaterializedViewDefinition"] = None, - computed_properties: Optional[List["_models.ComputedProperty"]] = None, - vector_embedding_policy: Optional["_models.VectorEmbeddingPolicy"] = None, - **kwargs: Any - ) -> None: - """ - :keyword id: Name of the Cosmos DB SQL container. Required. - :paramtype id: str - :keyword indexing_policy: The configuration of the indexing policy. By default, the indexing is - automatic for all document paths within the container. - :paramtype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy - :keyword partition_key: The configuration of the partition key to be used for partitioning data - into multiple partitions. - :paramtype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey - :keyword default_ttl: Default time to live. - :paramtype default_ttl: int - :keyword unique_key_policy: The unique key policy configuration for specifying uniqueness - constraints on documents in the collection in the Azure Cosmos DB service. - :paramtype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy - :keyword conflict_resolution_policy: The conflict resolution policy for the container. - :paramtype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy - :keyword client_encryption_policy: The client encryption policy for the container. - :paramtype client_encryption_policy: ~azure.mgmt.cosmosdb.models.ClientEncryptionPolicy - :keyword analytical_storage_ttl: Analytical TTL. - :paramtype analytical_storage_ttl: int - :keyword restore_parameters: Parameters to indicate the information about the restore. - :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: - "Default" and "Restore". - :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode - :keyword materialized_view_definition: The configuration for defining Materialized Views. This - must be specified only for creating a Materialized View container. - :paramtype materialized_view_definition: ~azure.mgmt.cosmosdb.models.MaterializedViewDefinition - :keyword computed_properties: List of computed properties. - :paramtype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty] - :keyword vector_embedding_policy: The vector embedding policy for the container. - :paramtype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy - """ - super().__init__( - id=id, - indexing_policy=indexing_policy, - partition_key=partition_key, - default_ttl=default_ttl, - unique_key_policy=unique_key_policy, - conflict_resolution_policy=conflict_resolution_policy, - client_encryption_policy=client_encryption_policy, - analytical_storage_ttl=analytical_storage_ttl, - restore_parameters=restore_parameters, - create_mode=create_mode, - materialized_view_definition=materialized_view_definition, - computed_properties=computed_properties, - vector_embedding_policy=vector_embedding_policy, - **kwargs - ) - self.rid = None - self.ts = None - self.etag = None - self.self_property = None - self.id = id - self.indexing_policy = indexing_policy - self.partition_key = partition_key - self.default_ttl = default_ttl - self.unique_key_policy = unique_key_policy - self.conflict_resolution_policy = conflict_resolution_policy - self.client_encryption_policy = client_encryption_policy - self.analytical_storage_ttl = analytical_storage_ttl - self.restore_parameters = restore_parameters - self.create_mode = create_mode - self.materialized_view_definition = materialized_view_definition - self.computed_properties = computed_properties - self.vector_embedding_policy = vector_embedding_policy + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None -class RestorableSqlContainersListResult(_serialization.Model): - """The List operation response, that contains the SQL container events and their properties. +class RestorableLocationResource(_serialization.Model): + """Properties of the regional restorable account. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of SQL container events and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.RestorableSqlContainerGetResult] + :ivar location_name: The location of the regional restorable account. + :vartype location_name: str + :ivar regional_database_account_instance_id: The instance id of the regional restorable + account. + :vartype regional_database_account_instance_id: str + :ivar creation_time: The creation time of the regional restorable database account (ISO-8601 + format). + :vartype creation_time: ~datetime.datetime + :ivar deletion_time: The time at which the regional restorable database account has been + deleted (ISO-8601 format). + :vartype deletion_time: ~datetime.datetime """ _validation = { - "value": {"readonly": True}, + "location_name": {"readonly": True}, + "regional_database_account_instance_id": {"readonly": True}, + "creation_time": {"readonly": True}, + "deletion_time": {"readonly": True}, } _attribute_map = { - "value": {"key": "value", "type": "[RestorableSqlContainerGetResult]"}, + "location_name": {"key": "locationName", "type": "str"}, + "regional_database_account_instance_id": {"key": "regionalDatabaseAccountInstanceId", "type": "str"}, + "creation_time": {"key": "creationTime", "type": "iso-8601"}, + "deletion_time": {"key": "deletionTime", "type": "iso-8601"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None + self.location_name = None + self.regional_database_account_instance_id = None + self.creation_time = None + self.deletion_time = None -class RestorableSqlDatabaseGetResult(_serialization.Model): - """An Azure Cosmos DB SQL database event. +class RestorableMongodbCollectionGetResult(_serialization.Model): + """An Azure Cosmos DB MongoDB collection event. Variables are only populated by the server, and will be ignored when sending a request. @@ -12982,8 +9500,8 @@ class RestorableSqlDatabaseGetResult(_serialization.Model): :vartype name: str :ivar type: The type of Azure resource. :vartype type: str - :ivar resource: The resource of an Azure Cosmos DB SQL database event. - :vartype resource: ~azure.mgmt.cosmosdb.models.RestorableSqlDatabasePropertiesResource + :ivar resource: The resource of an Azure Cosmos DB MongoDB collection event. + :vartype resource: ~azure.mgmt.cosmosdb.models.RestorableMongodbCollectionPropertiesResource """ _validation = { @@ -12996,15 +9514,15 @@ class RestorableSqlDatabaseGetResult(_serialization.Model): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "resource": {"key": "properties.resource", "type": "RestorableSqlDatabasePropertiesResource"}, + "resource": {"key": "properties.resource", "type": "RestorableMongodbCollectionPropertiesResource"}, } def __init__( - self, *, resource: Optional["_models.RestorableSqlDatabasePropertiesResource"] = None, **kwargs: Any + self, *, resource: Optional["_models.RestorableMongodbCollectionPropertiesResource"] = None, **kwargs: Any ) -> None: """ - :keyword resource: The resource of an Azure Cosmos DB SQL database event. - :paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableSqlDatabasePropertiesResource + :keyword resource: The resource of an Azure Cosmos DB MongoDB collection event. + :paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableMongodbCollectionPropertiesResource """ super().__init__(**kwargs) self.id = None @@ -13013,29 +9531,27 @@ def __init__( self.resource = resource -class RestorableSqlDatabasePropertiesResource(_serialization.Model): - """The resource of an Azure Cosmos DB SQL database event. +class RestorableMongodbCollectionPropertiesResource(_serialization.Model): # pylint: disable=name-too-long + """The resource of an Azure Cosmos DB MongoDB collection event. Variables are only populated by the server, and will be ignored when sending a request. :ivar rid: A system generated property. A unique identifier. :vartype rid: str - :ivar operation_type: The operation type of this database event. Known values are: "Create", + :ivar operation_type: The operation type of this collection event. Known values are: "Create", "Replace", "Delete", "Recreate", and "SystemOperation". :vartype operation_type: str or ~azure.mgmt.cosmosdb.models.OperationType - :ivar can_undelete: A state of this database to identify if this database is restorable in same - account. + :ivar can_undelete: A state of this collection to identify if this container is restorable in + same account. :vartype can_undelete: str - :ivar can_undelete_reason: The reason why this database can not be restored in same account. + :ivar can_undelete_reason: The reason why this collection can not be restored in same account. :vartype can_undelete_reason: str - :ivar event_timestamp: The time when this database event happened. + :ivar event_timestamp: The time when this collection event happened. :vartype event_timestamp: str - :ivar owner_id: The name of the SQL database. + :ivar owner_id: The name of this MongoDB collection. :vartype owner_id: str - :ivar owner_resource_id: The resource ID of the SQL database. + :ivar owner_resource_id: The resource ID of this MongoDB collection. :vartype owner_resource_id: str - :ivar database: Cosmos DB SQL database resource object. - :vartype database: ~azure.mgmt.cosmosdb.models.RestorableSqlDatabasePropertiesResourceDatabase """ _validation = { @@ -13056,17 +9572,10 @@ class RestorableSqlDatabasePropertiesResource(_serialization.Model): "event_timestamp": {"key": "eventTimestamp", "type": "str"}, "owner_id": {"key": "ownerId", "type": "str"}, "owner_resource_id": {"key": "ownerResourceId", "type": "str"}, - "database": {"key": "database", "type": "RestorableSqlDatabasePropertiesResourceDatabase"}, } - def __init__( - self, *, database: Optional["_models.RestorableSqlDatabasePropertiesResourceDatabase"] = None, **kwargs: Any - ) -> None: - """ - :keyword database: Cosmos DB SQL database resource object. - :paramtype database: - ~azure.mgmt.cosmosdb.models.RestorableSqlDatabasePropertiesResourceDatabase - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) self.rid = None self.operation_type = None @@ -13075,148 +9584,135 @@ def __init__( self.event_timestamp = None self.owner_id = None self.owner_resource_id = None - self.database = database -class SqlDatabaseResource(_serialization.Model): - """Cosmos DB SQL database resource object. +class RestorableMongodbCollectionsListResult(_serialization.Model): + """The List operation response, that contains the MongoDB collection events and their properties. - All required parameters must be populated in order to send to server. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Name of the Cosmos DB SQL database. Required. + :ivar value: List of MongoDB collection events and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.RestorableMongodbCollectionGetResult] + """ + + _validation = { + "value": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[RestorableMongodbCollectionGetResult]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None + + +class RestorableMongodbDatabaseGetResult(_serialization.Model): + """An Azure Cosmos DB MongoDB database event. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The unique resource Identifier of the ARM resource. :vartype id: str - :ivar restore_parameters: Parameters to indicate the information about the restore. - :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" - and "Restore". - :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :ivar name: The name of the ARM resource. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :ivar resource: The resource of an Azure Cosmos DB MongoDB database event. + :vartype resource: ~azure.mgmt.cosmosdb.models.RestorableMongodbDatabasePropertiesResource """ _validation = { - "id": {"required": True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, - "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, - "create_mode": {"key": "createMode", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "resource": {"key": "properties.resource", "type": "RestorableMongodbDatabasePropertiesResource"}, } def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, - create_mode: Union[str, "_models.CreateMode"] = "Default", - **kwargs: Any + self, *, resource: Optional["_models.RestorableMongodbDatabasePropertiesResource"] = None, **kwargs: Any ) -> None: """ - :keyword id: Name of the Cosmos DB SQL database. Required. - :paramtype id: str - :keyword restore_parameters: Parameters to indicate the information about the restore. - :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: - "Default" and "Restore". - :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :keyword resource: The resource of an Azure Cosmos DB MongoDB database event. + :paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableMongodbDatabasePropertiesResource """ super().__init__(**kwargs) - self.id = id - self.restore_parameters = restore_parameters - self.create_mode = create_mode + self.id = None + self.name = None + self.type = None + self.resource = resource -class RestorableSqlDatabasePropertiesResourceDatabase( - SqlDatabaseResource, ExtendedResourceProperties -): # pylint: disable=name-too-long - """Cosmos DB SQL database resource object. +class RestorableMongodbDatabasePropertiesResource(_serialization.Model): # pylint: disable=name-too-long + """The resource of an Azure Cosmos DB MongoDB database event. 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 rid: A system generated property. A unique identifier. :vartype rid: str - :ivar ts: A system generated property that denotes the last updated timestamp of the resource. - :vartype ts: float - :ivar etag: A system generated property representing the resource etag required for optimistic - concurrency control. - :vartype etag: str - :ivar id: Name of the Cosmos DB SQL database. Required. - :vartype id: str - :ivar restore_parameters: Parameters to indicate the information about the restore. - :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" - and "Restore". - :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode - :ivar colls: A system generated property that specified the addressable path of the collections - resource. - :vartype colls: str - :ivar users: A system generated property that specifies the addressable path of the users - resource. - :vartype users: str - :ivar self_property: A system generated property that specifies the addressable path of the - database resource. - :vartype self_property: str + :ivar operation_type: The operation type of this database event. Known values are: "Create", + "Replace", "Delete", "Recreate", and "SystemOperation". + :vartype operation_type: str or ~azure.mgmt.cosmosdb.models.OperationType + :ivar can_undelete: A state of this database to identify if this database is restorable in same + account. + :vartype can_undelete: str + :ivar can_undelete_reason: The reason why this database can not be restored in same account. + :vartype can_undelete_reason: str + :ivar event_timestamp: The time when this database event happened. + :vartype event_timestamp: str + :ivar owner_id: The name of this MongoDB database. + :vartype owner_id: str + :ivar owner_resource_id: The resource ID of this MongoDB database. + :vartype owner_resource_id: str """ _validation = { "rid": {"readonly": True}, - "ts": {"readonly": True}, - "etag": {"readonly": True}, - "id": {"required": True}, - "colls": {"readonly": True}, - "users": {"readonly": True}, - "self_property": {"readonly": True}, + "operation_type": {"readonly": True}, + "can_undelete": {"readonly": True}, + "can_undelete_reason": {"readonly": True}, + "event_timestamp": {"readonly": True}, + "owner_id": {"readonly": True}, + "owner_resource_id": {"readonly": True}, } _attribute_map = { "rid": {"key": "_rid", "type": "str"}, - "ts": {"key": "_ts", "type": "float"}, - "etag": {"key": "_etag", "type": "str"}, - "id": {"key": "id", "type": "str"}, - "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, - "create_mode": {"key": "createMode", "type": "str"}, - "colls": {"key": "_colls", "type": "str"}, - "users": {"key": "_users", "type": "str"}, - "self_property": {"key": "_self", "type": "str"}, + "operation_type": {"key": "operationType", "type": "str"}, + "can_undelete": {"key": "canUndelete", "type": "str"}, + "can_undelete_reason": {"key": "canUndeleteReason", "type": "str"}, + "event_timestamp": {"key": "eventTimestamp", "type": "str"}, + "owner_id": {"key": "ownerId", "type": "str"}, + "owner_resource_id": {"key": "ownerResourceId", "type": "str"}, } - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, - create_mode: Union[str, "_models.CreateMode"] = "Default", - **kwargs: Any - ) -> None: - """ - :keyword id: Name of the Cosmos DB SQL database. Required. - :paramtype id: str - :keyword restore_parameters: Parameters to indicate the information about the restore. - :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: - "Default" and "Restore". - :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode - """ - super().__init__(id=id, restore_parameters=restore_parameters, create_mode=create_mode, **kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.rid = None - self.ts = None - self.etag = None - self.colls = None - self.users = None - self.self_property = None - self.id = id - self.restore_parameters = restore_parameters - self.create_mode = create_mode + self.operation_type = None + self.can_undelete = None + self.can_undelete_reason = None + self.event_timestamp = None + self.owner_id = None + self.owner_resource_id = None -class RestorableSqlDatabasesListResult(_serialization.Model): - """The List operation response, that contains the SQL database events and their properties. +class RestorableMongodbDatabasesListResult(_serialization.Model): + """The List operation response, that contains the MongoDB database events and their properties. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of SQL database events and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.RestorableSqlDatabaseGetResult] + :ivar value: List of MongoDB database events and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.RestorableMongodbDatabaseGetResult] """ _validation = { @@ -13224,7 +9720,7 @@ class RestorableSqlDatabasesListResult(_serialization.Model): } _attribute_map = { - "value": {"key": "value", "type": "[RestorableSqlDatabaseGetResult]"}, + "value": {"key": "value", "type": "[RestorableMongodbDatabaseGetResult]"}, } def __init__(self, **kwargs: Any) -> None: @@ -13233,7 +9729,7 @@ def __init__(self, **kwargs: Any) -> None: self.value = None -class RestorableSqlResourcesGetResult(_serialization.Model): +class RestorableMongodbResourcesGetResult(_serialization.Model): """Specific Databases to restore. Variables are only populated by the server, and will be ignored when sending a request. @@ -13281,13 +9777,13 @@ def __init__( self.collection_names = collection_names -class RestorableSqlResourcesListResult(_serialization.Model): - """The List operation response, that contains the restorable SQL resources. +class RestorableMongodbResourcesListResult(_serialization.Model): + """The List operation response, that contains the restorable MongoDB resources. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of restorable SQL resources, including the database and collection names. - :vartype value: list[~azure.mgmt.cosmosdb.models.RestorableSqlResourcesGetResult] + :ivar value: List of restorable MongoDB resources, including the database and collection names. + :vartype value: list[~azure.mgmt.cosmosdb.models.RestorableMongodbResourcesGetResult] """ _validation = { @@ -13295,7 +9791,7 @@ class RestorableSqlResourcesListResult(_serialization.Model): } _attribute_map = { - "value": {"key": "value", "type": "[RestorableSqlResourcesGetResult]"}, + "value": {"key": "value", "type": "[RestorableMongodbResourcesGetResult]"}, } def __init__(self, **kwargs: Any) -> None: @@ -13304,8 +9800,8 @@ def __init__(self, **kwargs: Any) -> None: self.value = None -class RestorableTableGetResult(_serialization.Model): - """An Azure Cosmos DB Table event. +class RestorableSqlContainerGetResult(_serialization.Model): + """An Azure Cosmos DB SQL container event. Variables are only populated by the server, and will be ignored when sending a request. @@ -13315,8 +9811,8 @@ class RestorableTableGetResult(_serialization.Model): :vartype name: str :ivar type: The type of Azure resource. :vartype type: str - :ivar resource: The resource of an Azure Cosmos DB Table event. - :vartype resource: ~azure.mgmt.cosmosdb.models.RestorableTablePropertiesResource + :ivar resource: The resource of an Azure Cosmos DB SQL container event. + :vartype resource: ~azure.mgmt.cosmosdb.models.RestorableSqlContainerPropertiesResource """ _validation = { @@ -13329,15 +9825,15 @@ class RestorableTableGetResult(_serialization.Model): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "resource": {"key": "properties.resource", "type": "RestorableTablePropertiesResource"}, + "resource": {"key": "properties.resource", "type": "RestorableSqlContainerPropertiesResource"}, } def __init__( - self, *, resource: Optional["_models.RestorableTablePropertiesResource"] = None, **kwargs: Any + self, *, resource: Optional["_models.RestorableSqlContainerPropertiesResource"] = None, **kwargs: Any ) -> None: """ - :keyword resource: The resource of an Azure Cosmos DB Table event. - :paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableTablePropertiesResource + :keyword resource: The resource of an Azure Cosmos DB SQL container event. + :paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableSqlContainerPropertiesResource """ super().__init__(**kwargs) self.id = None @@ -13346,27 +9842,30 @@ def __init__( self.resource = resource -class RestorableTablePropertiesResource(_serialization.Model): - """The resource of an Azure Cosmos DB Table event. +class RestorableSqlContainerPropertiesResource(_serialization.Model): + """The resource of an Azure Cosmos DB SQL container event. Variables are only populated by the server, and will be ignored when sending a request. :ivar rid: A system generated property. A unique identifier. :vartype rid: str - :ivar operation_type: The operation type of this table event. Known values are: "Create", + :ivar operation_type: The operation type of this container event. Known values are: "Create", "Replace", "Delete", "Recreate", and "SystemOperation". :vartype operation_type: str or ~azure.mgmt.cosmosdb.models.OperationType - :ivar can_undelete: A state of this table to identify if this table is restorable in same - account. + :ivar can_undelete: A state of this container to identify if this container is restorable in + same account. :vartype can_undelete: str - :ivar can_undelete_reason: The reason why this table can not be restored in same account. + :ivar can_undelete_reason: The reason why this container can not be restored in same account. :vartype can_undelete_reason: str - :ivar event_timestamp: The time when this table event happened. + :ivar event_timestamp: The when this container event happened. :vartype event_timestamp: str - :ivar owner_id: The name of this Table. + :ivar owner_id: The name of this SQL container. :vartype owner_id: str - :ivar owner_resource_id: The resource ID of this Table. + :ivar owner_resource_id: The resource ID of this SQL container. :vartype owner_resource_id: str + :ivar container: Cosmos DB SQL container resource object. + :vartype container: + ~azure.mgmt.cosmosdb.models.RestorableSqlContainerPropertiesResourceContainer """ _validation = { @@ -13387,10 +9886,17 @@ class RestorableTablePropertiesResource(_serialization.Model): "event_timestamp": {"key": "eventTimestamp", "type": "str"}, "owner_id": {"key": "ownerId", "type": "str"}, "owner_resource_id": {"key": "ownerResourceId", "type": "str"}, + "container": {"key": "container", "type": "RestorableSqlContainerPropertiesResourceContainer"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, *, container: Optional["_models.RestorableSqlContainerPropertiesResourceContainer"] = None, **kwargs: Any + ) -> None: + """ + :keyword container: Cosmos DB SQL container resource object. + :paramtype container: + ~azure.mgmt.cosmosdb.models.RestorableSqlContainerPropertiesResourceContainer + """ super().__init__(**kwargs) self.rid = None self.operation_type = None @@ -13399,334 +9905,332 @@ def __init__(self, **kwargs: Any) -> None: self.event_timestamp = None self.owner_id = None self.owner_resource_id = None + self.container = container -class RestorableTableResourcesGetResult(_serialization.Model): - """Specific Databases to restore. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the Table. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class RestorableTableResourcesListResult(_serialization.Model): - """List of restorable table names. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of restorable table names. - :vartype value: list[~azure.mgmt.cosmosdb.models.RestorableTableResourcesGetResult] - """ - - _validation = { - "value": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[RestorableTableResourcesGetResult]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - - -class RestorableTablesListResult(_serialization.Model): - """The List operation response, that contains the Table events and their properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of Table events and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.RestorableTableGetResult] - """ - - _validation = { - "value": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[RestorableTableGetResult]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - - -class RestoreParameters(RestoreParametersBase): - """Parameters to indicate the information about the restore. - - :ivar restore_source: The id of the restorable database account from which the restore has to - be initiated. For example: - /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}. # pylint: disable=line-too-long - :vartype restore_source: str - :ivar restore_timestamp_in_utc: Time to which the account has to be restored (ISO-8601 format). - :vartype restore_timestamp_in_utc: ~datetime.datetime - :ivar restore_with_ttl_disabled: Specifies whether the restored account will have Time-To-Live - disabled upon the successful restore. - :vartype restore_with_ttl_disabled: bool - :ivar restore_mode: Describes the mode of the restore. "PointInTime" - :vartype restore_mode: str or ~azure.mgmt.cosmosdb.models.RestoreMode - :ivar databases_to_restore: List of specific databases available for restore. - :vartype databases_to_restore: list[~azure.mgmt.cosmosdb.models.DatabaseRestoreResource] - :ivar gremlin_databases_to_restore: List of specific gremlin databases available for restore. - :vartype gremlin_databases_to_restore: - list[~azure.mgmt.cosmosdb.models.GremlinDatabaseRestoreResource] - :ivar tables_to_restore: List of specific tables available for restore. - :vartype tables_to_restore: list[str] - :ivar source_backup_location: The source backup location for restore. - :vartype source_backup_location: str - """ - - _attribute_map = { - "restore_source": {"key": "restoreSource", "type": "str"}, - "restore_timestamp_in_utc": {"key": "restoreTimestampInUtc", "type": "iso-8601"}, - "restore_with_ttl_disabled": {"key": "restoreWithTtlDisabled", "type": "bool"}, - "restore_mode": {"key": "restoreMode", "type": "str"}, - "databases_to_restore": {"key": "databasesToRestore", "type": "[DatabaseRestoreResource]"}, - "gremlin_databases_to_restore": { - "key": "gremlinDatabasesToRestore", - "type": "[GremlinDatabaseRestoreResource]", - }, - "tables_to_restore": {"key": "tablesToRestore", "type": "[str]"}, - "source_backup_location": {"key": "sourceBackupLocation", "type": "str"}, - } - - def __init__( - self, - *, - restore_source: Optional[str] = None, - restore_timestamp_in_utc: Optional[datetime.datetime] = None, - restore_with_ttl_disabled: Optional[bool] = None, - restore_mode: Optional[Union[str, "_models.RestoreMode"]] = None, - databases_to_restore: Optional[List["_models.DatabaseRestoreResource"]] = None, - gremlin_databases_to_restore: Optional[List["_models.GremlinDatabaseRestoreResource"]] = None, - tables_to_restore: Optional[List[str]] = None, - source_backup_location: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword restore_source: The id of the restorable database account from which the restore has - to be initiated. For example: - /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}. # pylint: disable=line-too-long - :paramtype restore_source: str - :keyword restore_timestamp_in_utc: Time to which the account has to be restored (ISO-8601 - format). - :paramtype restore_timestamp_in_utc: ~datetime.datetime - :keyword restore_with_ttl_disabled: Specifies whether the restored account will have - Time-To-Live disabled upon the successful restore. - :paramtype restore_with_ttl_disabled: bool - :keyword restore_mode: Describes the mode of the restore. "PointInTime" - :paramtype restore_mode: str or ~azure.mgmt.cosmosdb.models.RestoreMode - :keyword databases_to_restore: List of specific databases available for restore. - :paramtype databases_to_restore: list[~azure.mgmt.cosmosdb.models.DatabaseRestoreResource] - :keyword gremlin_databases_to_restore: List of specific gremlin databases available for - restore. - :paramtype gremlin_databases_to_restore: - list[~azure.mgmt.cosmosdb.models.GremlinDatabaseRestoreResource] - :keyword tables_to_restore: List of specific tables available for restore. - :paramtype tables_to_restore: list[str] - :keyword source_backup_location: The source backup location for restore. - :paramtype source_backup_location: str - """ - super().__init__( - restore_source=restore_source, - restore_timestamp_in_utc=restore_timestamp_in_utc, - restore_with_ttl_disabled=restore_with_ttl_disabled, - **kwargs - ) - self.restore_mode = restore_mode - self.databases_to_restore = databases_to_restore - self.gremlin_databases_to_restore = gremlin_databases_to_restore - self.tables_to_restore = tables_to_restore - self.source_backup_location = source_backup_location - - -class RetrieveThroughputParameters(ARMResourceProperties): - """Cosmos DB retrieve throughput parameters object. - - Variables are only populated by the server, and will be ignored when sending a request. +class SqlContainerResource(_serialization.Model): + """Cosmos DB SQL container resource object. All required parameters must be populated in order to send to server. - :ivar id: The unique resource identifier of the ARM resource. + :ivar id: Name of the Cosmos DB SQL container. Required. :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar location: The location of the resource group to which the resource belongs. - :vartype location: str - :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :ivar resource: The standard JSON format of a resource throughput. Required. - :vartype resource: ~azure.mgmt.cosmosdb.models.RetrieveThroughputPropertiesResource + :ivar indexing_policy: The configuration of the indexing policy. By default, the indexing is + automatic for all document paths within the container. + :vartype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy + :ivar partition_key: The configuration of the partition key to be used for partitioning data + into multiple partitions. + :vartype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey + :ivar default_ttl: Default time to live. + :vartype default_ttl: int + :ivar unique_key_policy: The unique key policy configuration for specifying uniqueness + constraints on documents in the collection in the Azure Cosmos DB service. + :vartype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy + :ivar conflict_resolution_policy: The conflict resolution policy for the container. + :vartype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy + :ivar client_encryption_policy: The client encryption policy for the container. + :vartype client_encryption_policy: ~azure.mgmt.cosmosdb.models.ClientEncryptionPolicy + :ivar analytical_storage_ttl: Analytical TTL. + :vartype analytical_storage_ttl: int + :ivar restore_parameters: Parameters to indicate the information about the restore. + :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" + and "Restore". + :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :ivar computed_properties: List of computed properties. + :vartype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty] + :ivar vector_embedding_policy: The vector embedding policy for the container. + :vartype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy + :ivar full_text_policy: The FullText policy for the container. + :vartype full_text_policy: ~azure.mgmt.cosmosdb.models.FullTextPolicy """ _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "resource": {"required": True}, + "id": {"required": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "resource": {"key": "properties.resource", "type": "RetrieveThroughputPropertiesResource"}, + "indexing_policy": {"key": "indexingPolicy", "type": "IndexingPolicy"}, + "partition_key": {"key": "partitionKey", "type": "ContainerPartitionKey"}, + "default_ttl": {"key": "defaultTtl", "type": "int"}, + "unique_key_policy": {"key": "uniqueKeyPolicy", "type": "UniqueKeyPolicy"}, + "conflict_resolution_policy": {"key": "conflictResolutionPolicy", "type": "ConflictResolutionPolicy"}, + "client_encryption_policy": {"key": "clientEncryptionPolicy", "type": "ClientEncryptionPolicy"}, + "analytical_storage_ttl": {"key": "analyticalStorageTtl", "type": "int"}, + "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, + "create_mode": {"key": "createMode", "type": "str"}, + "computed_properties": {"key": "computedProperties", "type": "[ComputedProperty]"}, + "vector_embedding_policy": {"key": "vectorEmbeddingPolicy", "type": "VectorEmbeddingPolicy"}, + "full_text_policy": {"key": "fullTextPolicy", "type": "FullTextPolicy"}, } def __init__( self, *, - resource: "_models.RetrieveThroughputPropertiesResource", - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, + id: str, # pylint: disable=redefined-builtin + indexing_policy: Optional["_models.IndexingPolicy"] = None, + partition_key: Optional["_models.ContainerPartitionKey"] = None, + default_ttl: Optional[int] = None, + unique_key_policy: Optional["_models.UniqueKeyPolicy"] = None, + conflict_resolution_policy: Optional["_models.ConflictResolutionPolicy"] = None, + client_encryption_policy: Optional["_models.ClientEncryptionPolicy"] = None, + analytical_storage_ttl: Optional[int] = None, + restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, + create_mode: Union[str, "_models.CreateMode"] = "Default", + computed_properties: Optional[List["_models.ComputedProperty"]] = None, + vector_embedding_policy: Optional["_models.VectorEmbeddingPolicy"] = None, + full_text_policy: Optional["_models.FullTextPolicy"] = None, **kwargs: Any ) -> None: """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :keyword resource: The standard JSON format of a resource throughput. Required. - :paramtype resource: ~azure.mgmt.cosmosdb.models.RetrieveThroughputPropertiesResource + :keyword id: Name of the Cosmos DB SQL container. Required. + :paramtype id: str + :keyword indexing_policy: The configuration of the indexing policy. By default, the indexing is + automatic for all document paths within the container. + :paramtype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy + :keyword partition_key: The configuration of the partition key to be used for partitioning data + into multiple partitions. + :paramtype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey + :keyword default_ttl: Default time to live. + :paramtype default_ttl: int + :keyword unique_key_policy: The unique key policy configuration for specifying uniqueness + constraints on documents in the collection in the Azure Cosmos DB service. + :paramtype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy + :keyword conflict_resolution_policy: The conflict resolution policy for the container. + :paramtype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy + :keyword client_encryption_policy: The client encryption policy for the container. + :paramtype client_encryption_policy: ~azure.mgmt.cosmosdb.models.ClientEncryptionPolicy + :keyword analytical_storage_ttl: Analytical TTL. + :paramtype analytical_storage_ttl: int + :keyword restore_parameters: Parameters to indicate the information about the restore. + :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: + "Default" and "Restore". + :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :keyword computed_properties: List of computed properties. + :paramtype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty] + :keyword vector_embedding_policy: The vector embedding policy for the container. + :paramtype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy + :keyword full_text_policy: The FullText policy for the container. + :paramtype full_text_policy: ~azure.mgmt.cosmosdb.models.FullTextPolicy """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.resource = resource + super().__init__(**kwargs) + self.id = id + self.indexing_policy = indexing_policy + self.partition_key = partition_key + self.default_ttl = default_ttl + self.unique_key_policy = unique_key_policy + self.conflict_resolution_policy = conflict_resolution_policy + self.client_encryption_policy = client_encryption_policy + self.analytical_storage_ttl = analytical_storage_ttl + self.restore_parameters = restore_parameters + self.create_mode = create_mode + self.computed_properties = computed_properties + self.vector_embedding_policy = vector_embedding_policy + self.full_text_policy = full_text_policy + +class RestorableSqlContainerPropertiesResourceContainer( + SqlContainerResource, ExtendedResourceProperties +): # pylint: disable=name-too-long + """Cosmos DB SQL container resource object. -class RetrieveThroughputPropertiesResource(_serialization.Model): - """Resource to retrieve throughput information for Cosmos DB resource. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to server. - :ivar physical_partition_ids: Array of PhysicalPartitionId objects. Required. - :vartype physical_partition_ids: list[~azure.mgmt.cosmosdb.models.PhysicalPartitionId] + :ivar rid: A system generated property. A unique identifier. + :vartype rid: str + :ivar ts: A system generated property that denotes the last updated timestamp of the resource. + :vartype ts: float + :ivar etag: A system generated property representing the resource etag required for optimistic + concurrency control. + :vartype etag: str + :ivar id: Name of the Cosmos DB SQL container. Required. + :vartype id: str + :ivar indexing_policy: The configuration of the indexing policy. By default, the indexing is + automatic for all document paths within the container. + :vartype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy + :ivar partition_key: The configuration of the partition key to be used for partitioning data + into multiple partitions. + :vartype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey + :ivar default_ttl: Default time to live. + :vartype default_ttl: int + :ivar unique_key_policy: The unique key policy configuration for specifying uniqueness + constraints on documents in the collection in the Azure Cosmos DB service. + :vartype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy + :ivar conflict_resolution_policy: The conflict resolution policy for the container. + :vartype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy + :ivar client_encryption_policy: The client encryption policy for the container. + :vartype client_encryption_policy: ~azure.mgmt.cosmosdb.models.ClientEncryptionPolicy + :ivar analytical_storage_ttl: Analytical TTL. + :vartype analytical_storage_ttl: int + :ivar restore_parameters: Parameters to indicate the information about the restore. + :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" + and "Restore". + :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :ivar computed_properties: List of computed properties. + :vartype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty] + :ivar vector_embedding_policy: The vector embedding policy for the container. + :vartype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy + :ivar full_text_policy: The FullText policy for the container. + :vartype full_text_policy: ~azure.mgmt.cosmosdb.models.FullTextPolicy + :ivar self_property: A system generated property that specifies the addressable path of the + container resource. + :vartype self_property: str """ _validation = { - "physical_partition_ids": {"required": True}, + "rid": {"readonly": True}, + "ts": {"readonly": True}, + "etag": {"readonly": True}, + "id": {"required": True}, + "self_property": {"readonly": True}, } _attribute_map = { - "physical_partition_ids": {"key": "physicalPartitionIds", "type": "[PhysicalPartitionId]"}, + "rid": {"key": "_rid", "type": "str"}, + "ts": {"key": "_ts", "type": "float"}, + "etag": {"key": "_etag", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "indexing_policy": {"key": "indexingPolicy", "type": "IndexingPolicy"}, + "partition_key": {"key": "partitionKey", "type": "ContainerPartitionKey"}, + "default_ttl": {"key": "defaultTtl", "type": "int"}, + "unique_key_policy": {"key": "uniqueKeyPolicy", "type": "UniqueKeyPolicy"}, + "conflict_resolution_policy": {"key": "conflictResolutionPolicy", "type": "ConflictResolutionPolicy"}, + "client_encryption_policy": {"key": "clientEncryptionPolicy", "type": "ClientEncryptionPolicy"}, + "analytical_storage_ttl": {"key": "analyticalStorageTtl", "type": "int"}, + "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, + "create_mode": {"key": "createMode", "type": "str"}, + "computed_properties": {"key": "computedProperties", "type": "[ComputedProperty]"}, + "vector_embedding_policy": {"key": "vectorEmbeddingPolicy", "type": "VectorEmbeddingPolicy"}, + "full_text_policy": {"key": "fullTextPolicy", "type": "FullTextPolicy"}, + "self_property": {"key": "_self", "type": "str"}, } - def __init__(self, *, physical_partition_ids: List["_models.PhysicalPartitionId"], **kwargs: Any) -> None: + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + indexing_policy: Optional["_models.IndexingPolicy"] = None, + partition_key: Optional["_models.ContainerPartitionKey"] = None, + default_ttl: Optional[int] = None, + unique_key_policy: Optional["_models.UniqueKeyPolicy"] = None, + conflict_resolution_policy: Optional["_models.ConflictResolutionPolicy"] = None, + client_encryption_policy: Optional["_models.ClientEncryptionPolicy"] = None, + analytical_storage_ttl: Optional[int] = None, + restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, + create_mode: Union[str, "_models.CreateMode"] = "Default", + computed_properties: Optional[List["_models.ComputedProperty"]] = None, + vector_embedding_policy: Optional["_models.VectorEmbeddingPolicy"] = None, + full_text_policy: Optional["_models.FullTextPolicy"] = None, + **kwargs: Any + ) -> None: """ - :keyword physical_partition_ids: Array of PhysicalPartitionId objects. Required. - :paramtype physical_partition_ids: list[~azure.mgmt.cosmosdb.models.PhysicalPartitionId] + :keyword id: Name of the Cosmos DB SQL container. Required. + :paramtype id: str + :keyword indexing_policy: The configuration of the indexing policy. By default, the indexing is + automatic for all document paths within the container. + :paramtype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy + :keyword partition_key: The configuration of the partition key to be used for partitioning data + into multiple partitions. + :paramtype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey + :keyword default_ttl: Default time to live. + :paramtype default_ttl: int + :keyword unique_key_policy: The unique key policy configuration for specifying uniqueness + constraints on documents in the collection in the Azure Cosmos DB service. + :paramtype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy + :keyword conflict_resolution_policy: The conflict resolution policy for the container. + :paramtype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy + :keyword client_encryption_policy: The client encryption policy for the container. + :paramtype client_encryption_policy: ~azure.mgmt.cosmosdb.models.ClientEncryptionPolicy + :keyword analytical_storage_ttl: Analytical TTL. + :paramtype analytical_storage_ttl: int + :keyword restore_parameters: Parameters to indicate the information about the restore. + :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: + "Default" and "Restore". + :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :keyword computed_properties: List of computed properties. + :paramtype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty] + :keyword vector_embedding_policy: The vector embedding policy for the container. + :paramtype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy + :keyword full_text_policy: The FullText policy for the container. + :paramtype full_text_policy: ~azure.mgmt.cosmosdb.models.FullTextPolicy """ - super().__init__(**kwargs) - self.physical_partition_ids = physical_partition_ids - - -class Role(_serialization.Model): - """The set of roles permitted through this Role Definition. - - :ivar db: The database name the role is applied. - :vartype db: str - :ivar role: The role name. - :vartype role: str - """ - - _attribute_map = { - "db": {"key": "db", "type": "str"}, - "role": {"key": "role", "type": "str"}, - } + super().__init__( + id=id, + indexing_policy=indexing_policy, + partition_key=partition_key, + default_ttl=default_ttl, + unique_key_policy=unique_key_policy, + conflict_resolution_policy=conflict_resolution_policy, + client_encryption_policy=client_encryption_policy, + analytical_storage_ttl=analytical_storage_ttl, + restore_parameters=restore_parameters, + create_mode=create_mode, + computed_properties=computed_properties, + vector_embedding_policy=vector_embedding_policy, + full_text_policy=full_text_policy, + **kwargs + ) + self.rid = None + self.ts = None + self.etag = None + self.self_property = None + self.id = id + self.indexing_policy = indexing_policy + self.partition_key = partition_key + self.default_ttl = default_ttl + self.unique_key_policy = unique_key_policy + self.conflict_resolution_policy = conflict_resolution_policy + self.client_encryption_policy = client_encryption_policy + self.analytical_storage_ttl = analytical_storage_ttl + self.restore_parameters = restore_parameters + self.create_mode = create_mode + self.computed_properties = computed_properties + self.vector_embedding_policy = vector_embedding_policy + self.full_text_policy = full_text_policy - def __init__(self, *, db: Optional[str] = None, role: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword db: The database name the role is applied. - :paramtype db: str - :keyword role: The role name. - :paramtype role: str - """ - super().__init__(**kwargs) - self.db = db - self.role = role +class RestorableSqlContainersListResult(_serialization.Model): + """The List operation response, that contains the SQL container events and their properties. -class SeedNode(_serialization.Model): - """SeedNode. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar ip_address: IP address of this seed node. - :vartype ip_address: str + :ivar value: List of SQL container events and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.RestorableSqlContainerGetResult] """ + _validation = { + "value": {"readonly": True}, + } + _attribute_map = { - "ip_address": {"key": "ipAddress", "type": "str"}, + "value": {"key": "value", "type": "[RestorableSqlContainerGetResult]"}, } - def __init__(self, *, ip_address: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword ip_address: IP address of this seed node. - :paramtype ip_address: str - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.ip_address = ip_address + self.value = None -class ServiceResource(ARMProxyResource): - """Properties for the database account. +class RestorableSqlDatabaseGetResult(_serialization.Model): + """An Azure Cosmos DB SQL database event. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The unique resource identifier of the database account. + :ivar id: The unique resource Identifier of the ARM resource. :vartype id: str - :ivar name: The name of the database account. + :ivar name: The name of the ARM resource. :vartype name: str :ivar type: The type of Azure resource. :vartype type: str - :ivar properties: Services response resource. - :vartype properties: ~azure.mgmt.cosmosdb.models.ServiceResourceProperties + :ivar resource: The resource of an Azure Cosmos DB SQL database event. + :vartype resource: ~azure.mgmt.cosmosdb.models.RestorableSqlDatabasePropertiesResource """ _validation = { @@ -13739,192 +10243,139 @@ class ServiceResource(ARMProxyResource): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "properties": {"key": "properties", "type": "ServiceResourceProperties"}, - } - - def __init__(self, *, properties: Optional["_models.ServiceResourceProperties"] = None, **kwargs: Any) -> None: - """ - :keyword properties: Services response resource. - :paramtype properties: ~azure.mgmt.cosmosdb.models.ServiceResourceProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class ServiceResourceCreateUpdateParameters(_serialization.Model): - """Parameters for Create or Update request for ServiceResource. - - :ivar properties: Properties in ServiceResourceCreateUpdateParameters. - :vartype properties: ~azure.mgmt.cosmosdb.models.ServiceResourceCreateUpdateProperties - """ - - _attribute_map = { - "properties": {"key": "properties", "type": "ServiceResourceCreateUpdateProperties"}, + "resource": {"key": "properties.resource", "type": "RestorableSqlDatabasePropertiesResource"}, } def __init__( - self, *, properties: Optional["_models.ServiceResourceCreateUpdateProperties"] = None, **kwargs: Any + self, *, resource: Optional["_models.RestorableSqlDatabasePropertiesResource"] = None, **kwargs: Any ) -> None: """ - :keyword properties: Properties in ServiceResourceCreateUpdateParameters. - :paramtype properties: ~azure.mgmt.cosmosdb.models.ServiceResourceCreateUpdateProperties + :keyword resource: The resource of an Azure Cosmos DB SQL database event. + :paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableSqlDatabasePropertiesResource """ super().__init__(**kwargs) - self.properties = properties + self.id = None + self.name = None + self.type = None + self.resource = resource -class ServiceResourceListResult(_serialization.Model): - """The List operation response, that contains the Service Resource and their properties. +class RestorableSqlDatabasePropertiesResource(_serialization.Model): + """The resource of an Azure Cosmos DB SQL database event. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of Service Resource and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.ServiceResource] + :ivar rid: A system generated property. A unique identifier. + :vartype rid: str + :ivar operation_type: The operation type of this database event. Known values are: "Create", + "Replace", "Delete", "Recreate", and "SystemOperation". + :vartype operation_type: str or ~azure.mgmt.cosmosdb.models.OperationType + :ivar can_undelete: A state of this database to identify if this database is restorable in same + account. + :vartype can_undelete: str + :ivar can_undelete_reason: The reason why this database can not be restored in same account. + :vartype can_undelete_reason: str + :ivar event_timestamp: The time when this database event happened. + :vartype event_timestamp: str + :ivar owner_id: The name of the SQL database. + :vartype owner_id: str + :ivar owner_resource_id: The resource ID of the SQL database. + :vartype owner_resource_id: str + :ivar database: Cosmos DB SQL database resource object. + :vartype database: ~azure.mgmt.cosmosdb.models.RestorableSqlDatabasePropertiesResourceDatabase """ _validation = { - "value": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ServiceResource]"}, + "rid": {"readonly": True}, + "operation_type": {"readonly": True}, + "can_undelete": {"readonly": True}, + "can_undelete_reason": {"readonly": True}, + "event_timestamp": {"readonly": True}, + "owner_id": {"readonly": True}, + "owner_resource_id": {"readonly": True}, } - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - - -class SpatialSpec(_serialization.Model): - """SpatialSpec. - - :ivar path: The path for which the indexing behavior applies to. Index paths typically start - with root and end with wildcard (/path/*). - :vartype path: str - :ivar types: List of path's spatial type. - :vartype types: list[str or ~azure.mgmt.cosmosdb.models.SpatialType] - """ - _attribute_map = { - "path": {"key": "path", "type": "str"}, - "types": {"key": "types", "type": "[str]"}, + "rid": {"key": "_rid", "type": "str"}, + "operation_type": {"key": "operationType", "type": "str"}, + "can_undelete": {"key": "canUndelete", "type": "str"}, + "can_undelete_reason": {"key": "canUndeleteReason", "type": "str"}, + "event_timestamp": {"key": "eventTimestamp", "type": "str"}, + "owner_id": {"key": "ownerId", "type": "str"}, + "owner_resource_id": {"key": "ownerResourceId", "type": "str"}, + "database": {"key": "database", "type": "RestorableSqlDatabasePropertiesResourceDatabase"}, } def __init__( - self, - *, - path: Optional[str] = None, - types: Optional[List[Union[str, "_models.SpatialType"]]] = None, - **kwargs: Any + self, *, database: Optional["_models.RestorableSqlDatabasePropertiesResourceDatabase"] = None, **kwargs: Any ) -> None: """ - :keyword path: The path for which the indexing behavior applies to. Index paths typically start - with root and end with wildcard (/path/*). - :paramtype path: str - :keyword types: List of path's spatial type. - :paramtype types: list[str or ~azure.mgmt.cosmosdb.models.SpatialType] + :keyword database: Cosmos DB SQL database resource object. + :paramtype database: + ~azure.mgmt.cosmosdb.models.RestorableSqlDatabasePropertiesResourceDatabase """ super().__init__(**kwargs) - self.path = path - self.types = types - + self.rid = None + self.operation_type = None + self.can_undelete = None + self.can_undelete_reason = None + self.event_timestamp = None + self.owner_id = None + self.owner_resource_id = None + self.database = database -class SqlContainerCreateUpdateParameters(ARMResourceProperties): - """Parameters to create and update Cosmos DB container. - Variables are only populated by the server, and will be ignored when sending a request. +class SqlDatabaseResource(_serialization.Model): + """Cosmos DB SQL database resource object. All required parameters must be populated in order to send to server. - :ivar id: The unique resource identifier of the ARM resource. + :ivar id: Name of the Cosmos DB SQL database. Required. :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar location: The location of the resource group to which the resource belongs. - :vartype location: str - :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :ivar resource: The standard JSON format of a container. Required. - :vartype resource: ~azure.mgmt.cosmosdb.models.SqlContainerResource - :ivar options: A key-value pair of options to be applied for the request. This corresponds to - the headers sent with the request. - :vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions + :ivar restore_parameters: Parameters to indicate the information about the restore. + :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" + and "Restore". + :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode """ _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "resource": {"required": True}, + "id": {"required": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "resource": {"key": "properties.resource", "type": "SqlContainerResource"}, - "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, + "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, + "create_mode": {"key": "createMode", "type": "str"}, } - def __init__( - self, - *, - resource: "_models.SqlContainerResource", - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - options: Optional["_models.CreateUpdateOptions"] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :keyword resource: The standard JSON format of a container. Required. - :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlContainerResource - :keyword options: A key-value pair of options to be applied for the request. This corresponds - to the headers sent with the request. - :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions - """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.resource = resource - self.options = options - - -class SqlContainerGetPropertiesOptions(OptionsResource): - """SqlContainerGetPropertiesOptions. - - :ivar throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the - ThroughputSetting resource when retrieving offer details. - :vartype throughput: int - :ivar autoscale_settings: Specifies the Autoscale settings. - :vartype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings - """ + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, + create_mode: Union[str, "_models.CreateMode"] = "Default", + **kwargs: Any + ) -> None: + """ + :keyword id: Name of the Cosmos DB SQL database. Required. + :paramtype id: str + :keyword restore_parameters: Parameters to indicate the information about the restore. + :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: + "Default" and "Restore". + :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + """ + super().__init__(**kwargs) + self.id = id + self.restore_parameters = restore_parameters + self.create_mode = create_mode -class SqlContainerGetPropertiesResource(SqlContainerResource, ExtendedResourceProperties): - """SqlContainerGetPropertiesResource. +class RestorableSqlDatabasePropertiesResourceDatabase( + SqlDatabaseResource, ExtendedResourceProperties +): # pylint: disable=name-too-long + """Cosmos DB SQL database resource object. Variables are only populated by the server, and will be ignored when sending a request. @@ -13937,37 +10388,22 @@ class SqlContainerGetPropertiesResource(SqlContainerResource, ExtendedResourcePr :ivar etag: A system generated property representing the resource etag required for optimistic concurrency control. :vartype etag: str - :ivar id: Name of the Cosmos DB SQL container. Required. + :ivar id: Name of the Cosmos DB SQL database. Required. :vartype id: str - :ivar indexing_policy: The configuration of the indexing policy. By default, the indexing is - automatic for all document paths within the container. - :vartype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy - :ivar partition_key: The configuration of the partition key to be used for partitioning data - into multiple partitions. - :vartype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey - :ivar default_ttl: Default time to live. - :vartype default_ttl: int - :ivar unique_key_policy: The unique key policy configuration for specifying uniqueness - constraints on documents in the collection in the Azure Cosmos DB service. - :vartype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy - :ivar conflict_resolution_policy: The conflict resolution policy for the container. - :vartype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy - :ivar client_encryption_policy: The client encryption policy for the container. - :vartype client_encryption_policy: ~azure.mgmt.cosmosdb.models.ClientEncryptionPolicy - :ivar analytical_storage_ttl: Analytical TTL. - :vartype analytical_storage_ttl: int :ivar restore_parameters: Parameters to indicate the information about the restore. :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" and "Restore". :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode - :ivar materialized_view_definition: The configuration for defining Materialized Views. This - must be specified only for creating a Materialized View container. - :vartype materialized_view_definition: ~azure.mgmt.cosmosdb.models.MaterializedViewDefinition - :ivar computed_properties: List of computed properties. - :vartype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty] - :ivar vector_embedding_policy: The vector embedding policy for the container. - :vartype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy + :ivar colls: A system generated property that specified the addressable path of the collections + resource. + :vartype colls: str + :ivar users: A system generated property that specifies the addressable path of the users + resource. + :vartype users: str + :ivar self_property: A system generated property that specifies the addressable path of the + database resource. + :vartype self_property: str """ _validation = { @@ -13975,6 +10411,9 @@ class SqlContainerGetPropertiesResource(SqlContainerResource, ExtendedResourcePr "ts": {"readonly": True}, "etag": {"readonly": True}, "id": {"required": True}, + "colls": {"readonly": True}, + "users": {"readonly": True}, + "self_property": {"readonly": True}, } _attribute_map = { @@ -13982,107 +10421,67 @@ class SqlContainerGetPropertiesResource(SqlContainerResource, ExtendedResourcePr "ts": {"key": "_ts", "type": "float"}, "etag": {"key": "_etag", "type": "str"}, "id": {"key": "id", "type": "str"}, - "indexing_policy": {"key": "indexingPolicy", "type": "IndexingPolicy"}, - "partition_key": {"key": "partitionKey", "type": "ContainerPartitionKey"}, - "default_ttl": {"key": "defaultTtl", "type": "int"}, - "unique_key_policy": {"key": "uniqueKeyPolicy", "type": "UniqueKeyPolicy"}, - "conflict_resolution_policy": {"key": "conflictResolutionPolicy", "type": "ConflictResolutionPolicy"}, - "client_encryption_policy": {"key": "clientEncryptionPolicy", "type": "ClientEncryptionPolicy"}, - "analytical_storage_ttl": {"key": "analyticalStorageTtl", "type": "int"}, "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, "create_mode": {"key": "createMode", "type": "str"}, - "materialized_view_definition": {"key": "materializedViewDefinition", "type": "MaterializedViewDefinition"}, - "computed_properties": {"key": "computedProperties", "type": "[ComputedProperty]"}, - "vector_embedding_policy": {"key": "vectorEmbeddingPolicy", "type": "VectorEmbeddingPolicy"}, + "colls": {"key": "_colls", "type": "str"}, + "users": {"key": "_users", "type": "str"}, + "self_property": {"key": "_self", "type": "str"}, } def __init__( self, *, id: str, # pylint: disable=redefined-builtin - indexing_policy: Optional["_models.IndexingPolicy"] = None, - partition_key: Optional["_models.ContainerPartitionKey"] = None, - default_ttl: Optional[int] = None, - unique_key_policy: Optional["_models.UniqueKeyPolicy"] = None, - conflict_resolution_policy: Optional["_models.ConflictResolutionPolicy"] = None, - client_encryption_policy: Optional["_models.ClientEncryptionPolicy"] = None, - analytical_storage_ttl: Optional[int] = None, restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, create_mode: Union[str, "_models.CreateMode"] = "Default", - materialized_view_definition: Optional["_models.MaterializedViewDefinition"] = None, - computed_properties: Optional[List["_models.ComputedProperty"]] = None, - vector_embedding_policy: Optional["_models.VectorEmbeddingPolicy"] = None, **kwargs: Any ) -> None: """ - :keyword id: Name of the Cosmos DB SQL container. Required. + :keyword id: Name of the Cosmos DB SQL database. Required. :paramtype id: str - :keyword indexing_policy: The configuration of the indexing policy. By default, the indexing is - automatic for all document paths within the container. - :paramtype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy - :keyword partition_key: The configuration of the partition key to be used for partitioning data - into multiple partitions. - :paramtype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey - :keyword default_ttl: Default time to live. - :paramtype default_ttl: int - :keyword unique_key_policy: The unique key policy configuration for specifying uniqueness - constraints on documents in the collection in the Azure Cosmos DB service. - :paramtype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy - :keyword conflict_resolution_policy: The conflict resolution policy for the container. - :paramtype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy - :keyword client_encryption_policy: The client encryption policy for the container. - :paramtype client_encryption_policy: ~azure.mgmt.cosmosdb.models.ClientEncryptionPolicy - :keyword analytical_storage_ttl: Analytical TTL. - :paramtype analytical_storage_ttl: int :keyword restore_parameters: Parameters to indicate the information about the restore. :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" and "Restore". :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode - :keyword materialized_view_definition: The configuration for defining Materialized Views. This - must be specified only for creating a Materialized View container. - :paramtype materialized_view_definition: ~azure.mgmt.cosmosdb.models.MaterializedViewDefinition - :keyword computed_properties: List of computed properties. - :paramtype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty] - :keyword vector_embedding_policy: The vector embedding policy for the container. - :paramtype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy """ - super().__init__( - id=id, - indexing_policy=indexing_policy, - partition_key=partition_key, - default_ttl=default_ttl, - unique_key_policy=unique_key_policy, - conflict_resolution_policy=conflict_resolution_policy, - client_encryption_policy=client_encryption_policy, - analytical_storage_ttl=analytical_storage_ttl, - restore_parameters=restore_parameters, - create_mode=create_mode, - materialized_view_definition=materialized_view_definition, - computed_properties=computed_properties, - vector_embedding_policy=vector_embedding_policy, - **kwargs - ) + super().__init__(id=id, restore_parameters=restore_parameters, create_mode=create_mode, **kwargs) self.rid = None self.ts = None self.etag = None + self.colls = None + self.users = None + self.self_property = None self.id = id - self.indexing_policy = indexing_policy - self.partition_key = partition_key - self.default_ttl = default_ttl - self.unique_key_policy = unique_key_policy - self.conflict_resolution_policy = conflict_resolution_policy - self.client_encryption_policy = client_encryption_policy - self.analytical_storage_ttl = analytical_storage_ttl self.restore_parameters = restore_parameters self.create_mode = create_mode - self.materialized_view_definition = materialized_view_definition - self.computed_properties = computed_properties - self.vector_embedding_policy = vector_embedding_policy -class SqlContainerGetResults(ARMResourceProperties): - """An Azure Cosmos DB container. +class RestorableSqlDatabasesListResult(_serialization.Model): + """The List operation response, that contains the SQL database events and their properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of SQL database events and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.RestorableSqlDatabaseGetResult] + """ + + _validation = { + "value": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[RestorableSqlDatabaseGetResult]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None + + +class RestorableSqlResourcesGetResult(_serialization.Model): + """Specific Databases to restore. Variables are only populated by the server, and will be ignored when sending a request. @@ -14092,21 +10491,10 @@ class SqlContainerGetResults(ARMResourceProperties): :vartype name: str :ivar type: The type of Azure resource. :vartype type: str - :ivar location: The location of the resource group to which the resource belongs. - :vartype location: str - :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :ivar resource: - :vartype resource: ~azure.mgmt.cosmosdb.models.SqlContainerGetPropertiesResource - :ivar options: - :vartype options: ~azure.mgmt.cosmosdb.models.SqlContainerGetPropertiesOptions + :ivar database_name: The name of the database available for restore. + :vartype database_name: str + :ivar collection_names: The names of the collections available for restore. + :vartype collection_names: list[str] """ _validation = { @@ -14119,612 +10507,737 @@ class SqlContainerGetResults(ARMResourceProperties): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "resource": {"key": "properties.resource", "type": "SqlContainerGetPropertiesResource"}, - "options": {"key": "properties.options", "type": "SqlContainerGetPropertiesOptions"}, + "database_name": {"key": "databaseName", "type": "str"}, + "collection_names": {"key": "collectionNames", "type": "[str]"}, + } + + def __init__( + self, *, database_name: Optional[str] = None, collection_names: Optional[List[str]] = None, **kwargs: Any + ) -> None: + """ + :keyword database_name: The name of the database available for restore. + :paramtype database_name: str + :keyword collection_names: The names of the collections available for restore. + :paramtype collection_names: list[str] + """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.database_name = database_name + self.collection_names = collection_names + + +class RestorableSqlResourcesListResult(_serialization.Model): + """The List operation response, that contains the restorable SQL resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of restorable SQL resources, including the database and collection names. + :vartype value: list[~azure.mgmt.cosmosdb.models.RestorableSqlResourcesGetResult] + """ + + _validation = { + "value": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[RestorableSqlResourcesGetResult]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None + + +class RestorableTableGetResult(_serialization.Model): + """An Azure Cosmos DB Table event. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The unique resource Identifier of the ARM resource. + :vartype id: str + :ivar name: The name of the ARM resource. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :ivar resource: The resource of an Azure Cosmos DB Table event. + :vartype resource: ~azure.mgmt.cosmosdb.models.RestorableTablePropertiesResource + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "resource": {"key": "properties.resource", "type": "RestorableTablePropertiesResource"}, } def __init__( - self, - *, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - resource: Optional["_models.SqlContainerGetPropertiesResource"] = None, - options: Optional["_models.SqlContainerGetPropertiesOptions"] = None, - **kwargs: Any + self, *, resource: Optional["_models.RestorableTablePropertiesResource"] = None, **kwargs: Any ) -> None: """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :keyword resource: - :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlContainerGetPropertiesResource - :keyword options: - :paramtype options: ~azure.mgmt.cosmosdb.models.SqlContainerGetPropertiesOptions + :keyword resource: The resource of an Azure Cosmos DB Table event. + :paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableTablePropertiesResource """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None self.resource = resource - self.options = options -class SqlContainerListResult(_serialization.Model): - """The List operation response, that contains the containers and their properties. +class RestorableTablePropertiesResource(_serialization.Model): + """The resource of an Azure Cosmos DB Table event. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of containers and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] + :ivar rid: A system generated property. A unique identifier. + :vartype rid: str + :ivar operation_type: The operation type of this table event. Known values are: "Create", + "Replace", "Delete", "Recreate", and "SystemOperation". + :vartype operation_type: str or ~azure.mgmt.cosmosdb.models.OperationType + :ivar can_undelete: A state of this table to identify if this table is restorable in same + account. + :vartype can_undelete: str + :ivar can_undelete_reason: The reason why this table can not be restored in same account. + :vartype can_undelete_reason: str + :ivar event_timestamp: The time when this table event happened. + :vartype event_timestamp: str + :ivar owner_id: The name of this Table. + :vartype owner_id: str + :ivar owner_resource_id: The resource ID of this Table. + :vartype owner_resource_id: str """ _validation = { - "value": {"readonly": True}, + "rid": {"readonly": True}, + "operation_type": {"readonly": True}, + "can_undelete": {"readonly": True}, + "can_undelete_reason": {"readonly": True}, + "event_timestamp": {"readonly": True}, + "owner_id": {"readonly": True}, + "owner_resource_id": {"readonly": True}, } _attribute_map = { - "value": {"key": "value", "type": "[SqlContainerGetResults]"}, + "rid": {"key": "_rid", "type": "str"}, + "operation_type": {"key": "operationType", "type": "str"}, + "can_undelete": {"key": "canUndelete", "type": "str"}, + "can_undelete_reason": {"key": "canUndeleteReason", "type": "str"}, + "event_timestamp": {"key": "eventTimestamp", "type": "str"}, + "owner_id": {"key": "ownerId", "type": "str"}, + "owner_resource_id": {"key": "ownerResourceId", "type": "str"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None + self.rid = None + self.operation_type = None + self.can_undelete = None + self.can_undelete_reason = None + self.event_timestamp = None + self.owner_id = None + self.owner_resource_id = None -class SqlDatabaseCreateUpdateParameters(ARMResourceProperties): - """Parameters to create and update Cosmos DB SQL database. +class RestorableTableResourcesGetResult(_serialization.Model): + """Specific Databases to restore. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to server. - :ivar id: The unique resource identifier of the ARM resource. :vartype id: str - :ivar name: The name of the ARM resource. + :ivar name: The name of the Table. :vartype name: str :ivar type: The type of Azure resource. :vartype type: str - :ivar location: The location of the resource group to which the resource belongs. - :vartype location: str - :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :ivar resource: The standard JSON format of a SQL database. Required. - :vartype resource: ~azure.mgmt.cosmosdb.models.SqlDatabaseResource - :ivar options: A key-value pair of options to be applied for the request. This corresponds to - the headers sent with the request. - :vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, - "resource": {"required": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "resource": {"key": "properties.resource", "type": "SqlDatabaseResource"}, - "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, } - def __init__( - self, - *, - resource: "_models.SqlDatabaseResource", - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - options: Optional["_models.CreateUpdateOptions"] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :keyword resource: The standard JSON format of a SQL database. Required. - :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlDatabaseResource - :keyword options: A key-value pair of options to be applied for the request. This corresponds - to the headers sent with the request. - :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions - """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.resource = resource - self.options = options + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None -class SqlDatabaseGetPropertiesOptions(OptionsResource): - """SqlDatabaseGetPropertiesOptions. +class RestorableTableResourcesListResult(_serialization.Model): + """List of restorable table names. - :ivar throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the - ThroughputSetting resource when retrieving offer details. - :vartype throughput: int - :ivar autoscale_settings: Specifies the Autoscale settings. - :vartype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of restorable table names. + :vartype value: list[~azure.mgmt.cosmosdb.models.RestorableTableResourcesGetResult] """ + _validation = { + "value": {"readonly": True}, + } -class SqlDatabaseGetPropertiesResource(SqlDatabaseResource, ExtendedResourceProperties): - """SqlDatabaseGetPropertiesResource. + _attribute_map = { + "value": {"key": "value", "type": "[RestorableTableResourcesGetResult]"}, + } - Variables are only populated by the server, and will be ignored when sending a request. + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None - All required parameters must be populated in order to send to server. - :ivar rid: A system generated property. A unique identifier. - :vartype rid: str - :ivar ts: A system generated property that denotes the last updated timestamp of the resource. - :vartype ts: float - :ivar etag: A system generated property representing the resource etag required for optimistic - concurrency control. - :vartype etag: str - :ivar id: Name of the Cosmos DB SQL database. Required. - :vartype id: str - :ivar restore_parameters: Parameters to indicate the information about the restore. - :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" - and "Restore". - :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode - :ivar colls: A system generated property that specified the addressable path of the collections - resource. - :vartype colls: str - :ivar users: A system generated property that specifies the addressable path of the users - resource. - :vartype users: str +class RestorableTablesListResult(_serialization.Model): + """The List operation response, that contains the Table events and their properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Table events and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.RestorableTableGetResult] """ _validation = { - "rid": {"readonly": True}, - "ts": {"readonly": True}, - "etag": {"readonly": True}, - "id": {"required": True}, + "value": {"readonly": True}, } _attribute_map = { - "rid": {"key": "_rid", "type": "str"}, - "ts": {"key": "_ts", "type": "float"}, - "etag": {"key": "_etag", "type": "str"}, - "id": {"key": "id", "type": "str"}, - "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, - "create_mode": {"key": "createMode", "type": "str"}, - "colls": {"key": "_colls", "type": "str"}, - "users": {"key": "_users", "type": "str"}, + "value": {"key": "value", "type": "[RestorableTableGetResult]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None + + +class RestoreParameters(RestoreParametersBase): + """Parameters to indicate the information about the restore. + + :ivar restore_source: The id of the restorable database account from which the restore has to + be initiated. For example: + /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}. # pylint: disable=line-too-long + :vartype restore_source: str + :ivar restore_timestamp_in_utc: Time to which the account has to be restored (ISO-8601 format). + :vartype restore_timestamp_in_utc: ~datetime.datetime + :ivar restore_with_ttl_disabled: Specifies whether the restored account will have Time-To-Live + disabled upon the successful restore. + :vartype restore_with_ttl_disabled: bool + :ivar restore_mode: Describes the mode of the restore. "PointInTime" + :vartype restore_mode: str or ~azure.mgmt.cosmosdb.models.RestoreMode + :ivar databases_to_restore: List of specific databases available for restore. + :vartype databases_to_restore: list[~azure.mgmt.cosmosdb.models.DatabaseRestoreResource] + :ivar gremlin_databases_to_restore: List of specific gremlin databases available for restore. + :vartype gremlin_databases_to_restore: + list[~azure.mgmt.cosmosdb.models.GremlinDatabaseRestoreResource] + :ivar tables_to_restore: List of specific tables available for restore. + :vartype tables_to_restore: list[str] + """ + + _attribute_map = { + "restore_source": {"key": "restoreSource", "type": "str"}, + "restore_timestamp_in_utc": {"key": "restoreTimestampInUtc", "type": "iso-8601"}, + "restore_with_ttl_disabled": {"key": "restoreWithTtlDisabled", "type": "bool"}, + "restore_mode": {"key": "restoreMode", "type": "str"}, + "databases_to_restore": {"key": "databasesToRestore", "type": "[DatabaseRestoreResource]"}, + "gremlin_databases_to_restore": { + "key": "gremlinDatabasesToRestore", + "type": "[GremlinDatabaseRestoreResource]", + }, + "tables_to_restore": {"key": "tablesToRestore", "type": "[str]"}, } def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, - create_mode: Union[str, "_models.CreateMode"] = "Default", - colls: Optional[str] = None, - users: Optional[str] = None, + restore_source: Optional[str] = None, + restore_timestamp_in_utc: Optional[datetime.datetime] = None, + restore_with_ttl_disabled: Optional[bool] = None, + restore_mode: Optional[Union[str, "_models.RestoreMode"]] = None, + databases_to_restore: Optional[List["_models.DatabaseRestoreResource"]] = None, + gremlin_databases_to_restore: Optional[List["_models.GremlinDatabaseRestoreResource"]] = None, + tables_to_restore: Optional[List[str]] = None, **kwargs: Any ) -> None: """ - :keyword id: Name of the Cosmos DB SQL database. Required. - :paramtype id: str - :keyword restore_parameters: Parameters to indicate the information about the restore. - :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: - "Default" and "Restore". - :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode - :keyword colls: A system generated property that specified the addressable path of the - collections resource. - :paramtype colls: str - :keyword users: A system generated property that specifies the addressable path of the users - resource. - :paramtype users: str + :keyword restore_source: The id of the restorable database account from which the restore has + to be initiated. For example: + /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}. # pylint: disable=line-too-long + :paramtype restore_source: str + :keyword restore_timestamp_in_utc: Time to which the account has to be restored (ISO-8601 + format). + :paramtype restore_timestamp_in_utc: ~datetime.datetime + :keyword restore_with_ttl_disabled: Specifies whether the restored account will have + Time-To-Live disabled upon the successful restore. + :paramtype restore_with_ttl_disabled: bool + :keyword restore_mode: Describes the mode of the restore. "PointInTime" + :paramtype restore_mode: str or ~azure.mgmt.cosmosdb.models.RestoreMode + :keyword databases_to_restore: List of specific databases available for restore. + :paramtype databases_to_restore: list[~azure.mgmt.cosmosdb.models.DatabaseRestoreResource] + :keyword gremlin_databases_to_restore: List of specific gremlin databases available for + restore. + :paramtype gremlin_databases_to_restore: + list[~azure.mgmt.cosmosdb.models.GremlinDatabaseRestoreResource] + :keyword tables_to_restore: List of specific tables available for restore. + :paramtype tables_to_restore: list[str] """ - super().__init__(id=id, restore_parameters=restore_parameters, create_mode=create_mode, **kwargs) - self.rid = None - self.ts = None - self.etag = None - self.colls = colls - self.users = users - self.id = id - self.restore_parameters = restore_parameters - self.create_mode = create_mode - + super().__init__( + restore_source=restore_source, + restore_timestamp_in_utc=restore_timestamp_in_utc, + restore_with_ttl_disabled=restore_with_ttl_disabled, + **kwargs + ) + self.restore_mode = restore_mode + self.databases_to_restore = databases_to_restore + self.gremlin_databases_to_restore = gremlin_databases_to_restore + self.tables_to_restore = tables_to_restore -class SqlDatabaseGetResults(ARMResourceProperties): - """An Azure Cosmos DB SQL database. - Variables are only populated by the server, and will be ignored when sending a request. +class Role(_serialization.Model): + """The set of roles permitted through this Role Definition. - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar location: The location of the resource group to which the resource belongs. - :vartype location: str - :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :ivar resource: - :vartype resource: ~azure.mgmt.cosmosdb.models.SqlDatabaseGetPropertiesResource - :ivar options: - :vartype options: ~azure.mgmt.cosmosdb.models.SqlDatabaseGetPropertiesOptions + :ivar db: The database name the role is applied. + :vartype db: str + :ivar role: The role name. + :vartype role: str """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - } - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "resource": {"key": "properties.resource", "type": "SqlDatabaseGetPropertiesResource"}, - "options": {"key": "properties.options", "type": "SqlDatabaseGetPropertiesOptions"}, + "db": {"key": "db", "type": "str"}, + "role": {"key": "role", "type": "str"}, } - def __init__( - self, - *, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - resource: Optional["_models.SqlDatabaseGetPropertiesResource"] = None, - options: Optional["_models.SqlDatabaseGetPropertiesOptions"] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, db: Optional[str] = None, role: Optional[str] = None, **kwargs: Any) -> None: """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :keyword resource: - :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlDatabaseGetPropertiesResource - :keyword options: - :paramtype options: ~azure.mgmt.cosmosdb.models.SqlDatabaseGetPropertiesOptions + :keyword db: The database name the role is applied. + :paramtype db: str + :keyword role: The role name. + :paramtype role: str """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.resource = resource - self.options = options - + super().__init__(**kwargs) + self.db = db + self.role = role -class SqlDatabaseListResult(_serialization.Model): - """The List operation response, that contains the SQL databases and their properties. - Variables are only populated by the server, and will be ignored when sending a request. +class SeedNode(_serialization.Model): + """SeedNode. - :ivar value: List of SQL databases and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.SqlDatabaseGetResults] + :ivar ip_address: IP address of this seed node. + :vartype ip_address: str """ - _validation = { - "value": {"readonly": True}, - } - _attribute_map = { - "value": {"key": "value", "type": "[SqlDatabaseGetResults]"}, + "ip_address": {"key": "ipAddress", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, ip_address: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword ip_address: IP address of this seed node. + :paramtype ip_address: str + """ super().__init__(**kwargs) - self.value = None + self.ip_address = ip_address -class SqlDedicatedGatewayRegionalServiceResource(RegionalServiceResource): # pylint: disable=name-too-long - """Resource for a regional service location. +class ServiceResource(ARMProxyResource): + """Properties for the database account. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: The regional service name. + :ivar id: The unique resource identifier of the database account. + :vartype id: str + :ivar name: The name of the database account. :vartype name: str - :ivar location: The location name. - :vartype location: str - :ivar status: Describes the status of a service. Known values are: "Creating", "Running", - "Updating", "Deleting", "Error", and "Stopped". - :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus - :ivar sql_dedicated_gateway_endpoint: The regional endpoint for SqlDedicatedGateway. - :vartype sql_dedicated_gateway_endpoint: str + :ivar type: The type of Azure resource. + :vartype type: str + :ivar properties: Services response resource. + :vartype properties: ~azure.mgmt.cosmosdb.models.ServiceResourceProperties """ _validation = { + "id": {"readonly": True}, "name": {"readonly": True}, - "location": {"readonly": True}, - "status": {"readonly": True}, - "sql_dedicated_gateway_endpoint": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { + "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "status": {"key": "status", "type": "str"}, - "sql_dedicated_gateway_endpoint": {"key": "sqlDedicatedGatewayEndpoint", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "properties": {"key": "properties", "type": "ServiceResourceProperties"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, properties: Optional["_models.ServiceResourceProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Services response resource. + :paramtype properties: ~azure.mgmt.cosmosdb.models.ServiceResourceProperties + """ super().__init__(**kwargs) - self.sql_dedicated_gateway_endpoint = None + self.properties = properties -class SqlDedicatedGatewayServiceResource(_serialization.Model): - """Describes the service response property for SqlDedicatedGateway. +class ServiceResourceCreateUpdateParameters(_serialization.Model): + """Parameters for Create or Update request for ServiceResource. - :ivar properties: Properties for SqlDedicatedGatewayServiceResource. - :vartype properties: ~azure.mgmt.cosmosdb.models.SqlDedicatedGatewayServiceResourceProperties + :ivar properties: Properties in ServiceResourceCreateUpdateParameters. + :vartype properties: ~azure.mgmt.cosmosdb.models.ServiceResourceCreateUpdateProperties """ _attribute_map = { - "properties": {"key": "properties", "type": "SqlDedicatedGatewayServiceResourceProperties"}, + "properties": {"key": "properties", "type": "ServiceResourceCreateUpdateProperties"}, } def __init__( - self, *, properties: Optional["_models.SqlDedicatedGatewayServiceResourceProperties"] = None, **kwargs: Any + self, *, properties: Optional["_models.ServiceResourceCreateUpdateProperties"] = None, **kwargs: Any ) -> None: """ - :keyword properties: Properties for SqlDedicatedGatewayServiceResource. - :paramtype properties: ~azure.mgmt.cosmosdb.models.SqlDedicatedGatewayServiceResourceProperties + :keyword properties: Properties in ServiceResourceCreateUpdateParameters. + :paramtype properties: ~azure.mgmt.cosmosdb.models.ServiceResourceCreateUpdateProperties """ super().__init__(**kwargs) self.properties = properties -class SqlDedicatedGatewayServiceResourceCreateUpdateProperties( - ServiceResourceCreateUpdateProperties -): # pylint: disable=name-too-long - """Properties for Create or Update request for SqlDedicatedGatewayServiceResource. +class ServiceResourceListResult(_serialization.Model): + """The List operation response, that contains the Service Resource and their properties. - All required parameters must be populated in order to send to server. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", - "Cosmos.D8s", and "Cosmos.D16s". - :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize - :ivar instance_count: Instance count for the service. - :vartype instance_count: int - :ivar service_type: ServiceType for the service. Required. Known values are: - "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". - :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType - :ivar dedicated_gateway_type: DedicatedGatewayType for the service. Known values are: - "IntegratedCache" and "DistributedQuery". - :vartype dedicated_gateway_type: str or ~azure.mgmt.cosmosdb.models.DedicatedGatewayType + :ivar value: List of Service Resource and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.ServiceResource] """ - _validation = { - "instance_count": {"minimum": 0}, - "service_type": {"required": True}, + _validation = { + "value": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ServiceResource]"}, } + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None + + +class SpatialSpec(_serialization.Model): + """SpatialSpec. + + :ivar path: The path for which the indexing behavior applies to. Index paths typically start + with root and end with wildcard (/path/*). + :vartype path: str + :ivar types: List of path's spatial type. + :vartype types: list[str or ~azure.mgmt.cosmosdb.models.SpatialType] + """ + _attribute_map = { - "instance_size": {"key": "instanceSize", "type": "str"}, - "instance_count": {"key": "instanceCount", "type": "int"}, - "service_type": {"key": "serviceType", "type": "str"}, - "dedicated_gateway_type": {"key": "dedicatedGatewayType", "type": "str"}, + "path": {"key": "path", "type": "str"}, + "types": {"key": "types", "type": "[str]"}, } def __init__( self, *, - instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, - instance_count: Optional[int] = None, - dedicated_gateway_type: Optional[Union[str, "_models.DedicatedGatewayType"]] = None, + path: Optional[str] = None, + types: Optional[List[Union[str, "_models.SpatialType"]]] = None, **kwargs: Any ) -> None: """ - :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", - "Cosmos.D8s", and "Cosmos.D16s". - :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize - :keyword instance_count: Instance count for the service. - :paramtype instance_count: int - :keyword dedicated_gateway_type: DedicatedGatewayType for the service. Known values are: - "IntegratedCache" and "DistributedQuery". - :paramtype dedicated_gateway_type: str or ~azure.mgmt.cosmosdb.models.DedicatedGatewayType + :keyword path: The path for which the indexing behavior applies to. Index paths typically start + with root and end with wildcard (/path/*). + :paramtype path: str + :keyword types: List of path's spatial type. + :paramtype types: list[str or ~azure.mgmt.cosmosdb.models.SpatialType] """ - super().__init__(instance_size=instance_size, instance_count=instance_count, **kwargs) - self.service_type: str = "SqlDedicatedGateway" - self.dedicated_gateway_type = dedicated_gateway_type + super().__init__(**kwargs) + self.path = path + self.types = types -class SqlDedicatedGatewayServiceResourceProperties(ServiceResourceProperties): # pylint: disable=name-too-long - """Properties for SqlDedicatedGatewayServiceResource. +class SqlContainerCreateUpdateParameters(ARMResourceProperties): + """Parameters to create and update Cosmos DB container. 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 additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar creation_time: Time of the last state change (ISO-8601 format). - :vartype creation_time: ~datetime.datetime - :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", - "Cosmos.D8s", and "Cosmos.D16s". - :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize - :ivar instance_count: Instance count for the service. - :vartype instance_count: int - :ivar service_type: ServiceType for the service. Required. Known values are: - "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". - :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType - :ivar status: Describes the status of a service. Known values are: "Creating", "Running", - "Updating", "Deleting", "Error", and "Stopped". - :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus - :ivar sql_dedicated_gateway_endpoint: SqlDedicatedGateway endpoint for the service. - :vartype sql_dedicated_gateway_endpoint: str - :ivar dedicated_gateway_type: DedicatedGatewayType for the service. Known values are: - "IntegratedCache" and "DistributedQuery". - :vartype dedicated_gateway_type: str or ~azure.mgmt.cosmosdb.models.DedicatedGatewayType - :ivar locations: An array that contains all of the locations for the service. - :vartype locations: - list[~azure.mgmt.cosmosdb.models.SqlDedicatedGatewayRegionalServiceResource] + :ivar id: The unique resource identifier of the ARM resource. + :vartype id: str + :ivar name: The name of the ARM resource. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :ivar location: The location of the resource group to which the resource belongs. + :vartype location: str + :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :vartype tags: dict[str, str] + :ivar resource: The standard JSON format of a container. Required. + :vartype resource: ~azure.mgmt.cosmosdb.models.SqlContainerResource + :ivar options: A key-value pair of options to be applied for the request. This corresponds to + the headers sent with the request. + :vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ _validation = { - "creation_time": {"readonly": True}, - "instance_count": {"minimum": 0}, - "service_type": {"required": True}, - "status": {"readonly": True}, - "locations": {"readonly": True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "resource": {"required": True}, } _attribute_map = { - "additional_properties": {"key": "", "type": "{object}"}, - "creation_time": {"key": "creationTime", "type": "iso-8601"}, - "instance_size": {"key": "instanceSize", "type": "str"}, - "instance_count": {"key": "instanceCount", "type": "int"}, - "service_type": {"key": "serviceType", "type": "str"}, - "status": {"key": "status", "type": "str"}, - "sql_dedicated_gateway_endpoint": {"key": "sqlDedicatedGatewayEndpoint", "type": "str"}, - "dedicated_gateway_type": {"key": "dedicatedGatewayType", "type": "str"}, - "locations": {"key": "locations", "type": "[SqlDedicatedGatewayRegionalServiceResource]"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "resource": {"key": "properties.resource", "type": "SqlContainerResource"}, + "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, } def __init__( self, *, - additional_properties: Optional[Dict[str, Any]] = None, - instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, - instance_count: Optional[int] = None, - sql_dedicated_gateway_endpoint: Optional[str] = None, - dedicated_gateway_type: Optional[Union[str, "_models.DedicatedGatewayType"]] = None, + resource: "_models.SqlContainerResource", + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + options: Optional["_models.CreateUpdateOptions"] = None, **kwargs: Any ) -> None: """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", - "Cosmos.D8s", and "Cosmos.D16s". - :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize - :keyword instance_count: Instance count for the service. - :paramtype instance_count: int - :keyword sql_dedicated_gateway_endpoint: SqlDedicatedGateway endpoint for the service. - :paramtype sql_dedicated_gateway_endpoint: str - :keyword dedicated_gateway_type: DedicatedGatewayType for the service. Known values are: - "IntegratedCache" and "DistributedQuery". - :paramtype dedicated_gateway_type: str or ~azure.mgmt.cosmosdb.models.DedicatedGatewayType + :keyword location: The location of the resource group to which the resource belongs. + :paramtype location: str + :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :paramtype tags: dict[str, str] + :keyword resource: The standard JSON format of a container. Required. + :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlContainerResource + :keyword options: A key-value pair of options to be applied for the request. This corresponds + to the headers sent with the request. + :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ - super().__init__( - additional_properties=additional_properties, - instance_size=instance_size, - instance_count=instance_count, - **kwargs - ) - self.service_type: str = "SqlDedicatedGateway" - self.sql_dedicated_gateway_endpoint = sql_dedicated_gateway_endpoint - self.dedicated_gateway_type = dedicated_gateway_type - self.locations = None + super().__init__(location=location, tags=tags, **kwargs) + self.resource = resource + self.options = options -class SqlRoleAssignmentCreateUpdateParameters(_serialization.Model): - """Parameters to create and update an Azure Cosmos DB SQL Role Assignment. +class SqlContainerGetPropertiesOptions(OptionsResource): + """SqlContainerGetPropertiesOptions. - :ivar role_definition_id: The unique identifier for the associated Role Definition. - :vartype role_definition_id: str - :ivar scope: The data plane resource path for which access is being granted through this Role - Assignment. - :vartype scope: str - :ivar principal_id: The unique identifier for the associated AAD principal in the AAD graph to - which access is being granted through this Role Assignment. Tenant ID for the principal is - inferred using the tenant associated with the subscription. - :vartype principal_id: str + :ivar throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the + ThroughputSetting resource when retrieving offer details. + :vartype throughput: int + :ivar autoscale_settings: Specifies the Autoscale settings. + :vartype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings + """ + + +class SqlContainerGetPropertiesResource(SqlContainerResource, ExtendedResourceProperties): + """SqlContainerGetPropertiesResource. + + 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 rid: A system generated property. A unique identifier. + :vartype rid: str + :ivar ts: A system generated property that denotes the last updated timestamp of the resource. + :vartype ts: float + :ivar etag: A system generated property representing the resource etag required for optimistic + concurrency control. + :vartype etag: str + :ivar id: Name of the Cosmos DB SQL container. Required. + :vartype id: str + :ivar indexing_policy: The configuration of the indexing policy. By default, the indexing is + automatic for all document paths within the container. + :vartype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy + :ivar partition_key: The configuration of the partition key to be used for partitioning data + into multiple partitions. + :vartype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey + :ivar default_ttl: Default time to live. + :vartype default_ttl: int + :ivar unique_key_policy: The unique key policy configuration for specifying uniqueness + constraints on documents in the collection in the Azure Cosmos DB service. + :vartype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy + :ivar conflict_resolution_policy: The conflict resolution policy for the container. + :vartype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy + :ivar client_encryption_policy: The client encryption policy for the container. + :vartype client_encryption_policy: ~azure.mgmt.cosmosdb.models.ClientEncryptionPolicy + :ivar analytical_storage_ttl: Analytical TTL. + :vartype analytical_storage_ttl: int + :ivar restore_parameters: Parameters to indicate the information about the restore. + :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" + and "Restore". + :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :ivar computed_properties: List of computed properties. + :vartype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty] + :ivar vector_embedding_policy: The vector embedding policy for the container. + :vartype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy + :ivar full_text_policy: The FullText policy for the container. + :vartype full_text_policy: ~azure.mgmt.cosmosdb.models.FullTextPolicy """ + _validation = { + "rid": {"readonly": True}, + "ts": {"readonly": True}, + "etag": {"readonly": True}, + "id": {"required": True}, + } + _attribute_map = { - "role_definition_id": {"key": "properties.roleDefinitionId", "type": "str"}, - "scope": {"key": "properties.scope", "type": "str"}, - "principal_id": {"key": "properties.principalId", "type": "str"}, + "rid": {"key": "_rid", "type": "str"}, + "ts": {"key": "_ts", "type": "float"}, + "etag": {"key": "_etag", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "indexing_policy": {"key": "indexingPolicy", "type": "IndexingPolicy"}, + "partition_key": {"key": "partitionKey", "type": "ContainerPartitionKey"}, + "default_ttl": {"key": "defaultTtl", "type": "int"}, + "unique_key_policy": {"key": "uniqueKeyPolicy", "type": "UniqueKeyPolicy"}, + "conflict_resolution_policy": {"key": "conflictResolutionPolicy", "type": "ConflictResolutionPolicy"}, + "client_encryption_policy": {"key": "clientEncryptionPolicy", "type": "ClientEncryptionPolicy"}, + "analytical_storage_ttl": {"key": "analyticalStorageTtl", "type": "int"}, + "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, + "create_mode": {"key": "createMode", "type": "str"}, + "computed_properties": {"key": "computedProperties", "type": "[ComputedProperty]"}, + "vector_embedding_policy": {"key": "vectorEmbeddingPolicy", "type": "VectorEmbeddingPolicy"}, + "full_text_policy": {"key": "fullTextPolicy", "type": "FullTextPolicy"}, } def __init__( self, *, - role_definition_id: Optional[str] = None, - scope: Optional[str] = None, - principal_id: Optional[str] = None, + id: str, # pylint: disable=redefined-builtin + indexing_policy: Optional["_models.IndexingPolicy"] = None, + partition_key: Optional["_models.ContainerPartitionKey"] = None, + default_ttl: Optional[int] = None, + unique_key_policy: Optional["_models.UniqueKeyPolicy"] = None, + conflict_resolution_policy: Optional["_models.ConflictResolutionPolicy"] = None, + client_encryption_policy: Optional["_models.ClientEncryptionPolicy"] = None, + analytical_storage_ttl: Optional[int] = None, + restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, + create_mode: Union[str, "_models.CreateMode"] = "Default", + computed_properties: Optional[List["_models.ComputedProperty"]] = None, + vector_embedding_policy: Optional["_models.VectorEmbeddingPolicy"] = None, + full_text_policy: Optional["_models.FullTextPolicy"] = None, **kwargs: Any ) -> None: """ - :keyword role_definition_id: The unique identifier for the associated Role Definition. - :paramtype role_definition_id: str - :keyword scope: The data plane resource path for which access is being granted through this - Role Assignment. - :paramtype scope: str - :keyword principal_id: The unique identifier for the associated AAD principal in the AAD graph - to which access is being granted through this Role Assignment. Tenant ID for the principal is - inferred using the tenant associated with the subscription. - :paramtype principal_id: str + :keyword id: Name of the Cosmos DB SQL container. Required. + :paramtype id: str + :keyword indexing_policy: The configuration of the indexing policy. By default, the indexing is + automatic for all document paths within the container. + :paramtype indexing_policy: ~azure.mgmt.cosmosdb.models.IndexingPolicy + :keyword partition_key: The configuration of the partition key to be used for partitioning data + into multiple partitions. + :paramtype partition_key: ~azure.mgmt.cosmosdb.models.ContainerPartitionKey + :keyword default_ttl: Default time to live. + :paramtype default_ttl: int + :keyword unique_key_policy: The unique key policy configuration for specifying uniqueness + constraints on documents in the collection in the Azure Cosmos DB service. + :paramtype unique_key_policy: ~azure.mgmt.cosmosdb.models.UniqueKeyPolicy + :keyword conflict_resolution_policy: The conflict resolution policy for the container. + :paramtype conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy + :keyword client_encryption_policy: The client encryption policy for the container. + :paramtype client_encryption_policy: ~azure.mgmt.cosmosdb.models.ClientEncryptionPolicy + :keyword analytical_storage_ttl: Analytical TTL. + :paramtype analytical_storage_ttl: int + :keyword restore_parameters: Parameters to indicate the information about the restore. + :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: + "Default" and "Restore". + :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :keyword computed_properties: List of computed properties. + :paramtype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty] + :keyword vector_embedding_policy: The vector embedding policy for the container. + :paramtype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy + :keyword full_text_policy: The FullText policy for the container. + :paramtype full_text_policy: ~azure.mgmt.cosmosdb.models.FullTextPolicy """ - super().__init__(**kwargs) - self.role_definition_id = role_definition_id - self.scope = scope - self.principal_id = principal_id + super().__init__( + id=id, + indexing_policy=indexing_policy, + partition_key=partition_key, + default_ttl=default_ttl, + unique_key_policy=unique_key_policy, + conflict_resolution_policy=conflict_resolution_policy, + client_encryption_policy=client_encryption_policy, + analytical_storage_ttl=analytical_storage_ttl, + restore_parameters=restore_parameters, + create_mode=create_mode, + computed_properties=computed_properties, + vector_embedding_policy=vector_embedding_policy, + full_text_policy=full_text_policy, + **kwargs + ) + self.rid = None + self.ts = None + self.etag = None + self.id = id + self.indexing_policy = indexing_policy + self.partition_key = partition_key + self.default_ttl = default_ttl + self.unique_key_policy = unique_key_policy + self.conflict_resolution_policy = conflict_resolution_policy + self.client_encryption_policy = client_encryption_policy + self.analytical_storage_ttl = analytical_storage_ttl + self.restore_parameters = restore_parameters + self.create_mode = create_mode + self.computed_properties = computed_properties + self.vector_embedding_policy = vector_embedding_policy + self.full_text_policy = full_text_policy -class SqlRoleAssignmentGetResults(ARMProxyResource): - """An Azure Cosmos DB Role Assignment. +class SqlContainerGetResults(ARMResourceProperties): + """An Azure Cosmos DB container. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The unique resource identifier of the database account. + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str - :ivar name: The name of the database account. + :ivar name: The name of the ARM resource. :vartype name: str :ivar type: The type of Azure resource. :vartype type: str - :ivar role_definition_id: The unique identifier for the associated Role Definition. - :vartype role_definition_id: str - :ivar scope: The data plane resource path for which access is being granted through this Role - Assignment. - :vartype scope: str - :ivar principal_id: The unique identifier for the associated AAD principal in the AAD graph to - which access is being granted through this Role Assignment. Tenant ID for the principal is - inferred using the tenant associated with the subscription. - :vartype principal_id: str + :ivar location: The location of the resource group to which the resource belongs. + :vartype location: str + :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :vartype tags: dict[str, str] + :ivar resource: + :vartype resource: ~azure.mgmt.cosmosdb.models.SqlContainerGetPropertiesResource + :ivar options: + :vartype options: ~azure.mgmt.cosmosdb.models.SqlContainerGetPropertiesOptions """ _validation = { @@ -14737,43 +11250,48 @@ class SqlRoleAssignmentGetResults(ARMProxyResource): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "role_definition_id": {"key": "properties.roleDefinitionId", "type": "str"}, - "scope": {"key": "properties.scope", "type": "str"}, - "principal_id": {"key": "properties.principalId", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "resource": {"key": "properties.resource", "type": "SqlContainerGetPropertiesResource"}, + "options": {"key": "properties.options", "type": "SqlContainerGetPropertiesOptions"}, } def __init__( self, *, - role_definition_id: Optional[str] = None, - scope: Optional[str] = None, - principal_id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + resource: Optional["_models.SqlContainerGetPropertiesResource"] = None, + options: Optional["_models.SqlContainerGetPropertiesOptions"] = None, **kwargs: Any ) -> None: """ - :keyword role_definition_id: The unique identifier for the associated Role Definition. - :paramtype role_definition_id: str - :keyword scope: The data plane resource path for which access is being granted through this - Role Assignment. - :paramtype scope: str - :keyword principal_id: The unique identifier for the associated AAD principal in the AAD graph - to which access is being granted through this Role Assignment. Tenant ID for the principal is - inferred using the tenant associated with the subscription. - :paramtype principal_id: str + :keyword location: The location of the resource group to which the resource belongs. + :paramtype location: str + :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :paramtype tags: dict[str, str] + :keyword resource: + :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlContainerGetPropertiesResource + :keyword options: + :paramtype options: ~azure.mgmt.cosmosdb.models.SqlContainerGetPropertiesOptions """ - super().__init__(**kwargs) - self.role_definition_id = role_definition_id - self.scope = scope - self.principal_id = principal_id + super().__init__(location=location, tags=tags, **kwargs) + self.resource = resource + self.options = options -class SqlRoleAssignmentListResult(_serialization.Model): - """The relevant Role Assignments. +class SqlContainerListResult(_serialization.Model): + """The List operation response, that contains the containers and their properties. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of Role Assignments and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.SqlRoleAssignmentGetResults] + :ivar value: List of containers and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] """ _validation = { @@ -14781,7 +11299,7 @@ class SqlRoleAssignmentListResult(_serialization.Model): } _attribute_map = { - "value": {"key": "value", "type": "[SqlRoleAssignmentGetResults]"}, + "value": {"key": "value", "type": "[SqlContainerGetResults]"}, } def __init__(self, **kwargs: Any) -> None: @@ -14790,169 +11308,181 @@ def __init__(self, **kwargs: Any) -> None: self.value = None -class SqlRoleDefinitionCreateUpdateParameters(_serialization.Model): - """Parameters to create and update an Azure Cosmos DB SQL Role Definition. - - :ivar role_name: A user-friendly name for the Role Definition. Must be unique for the database - account. - :vartype role_name: str - :ivar type: Indicates whether the Role Definition was built-in or user created. Known values - are: "BuiltInRole" and "CustomRole". - :vartype type: str or ~azure.mgmt.cosmosdb.models.RoleDefinitionType - :ivar assignable_scopes: A set of fully qualified Scopes at or below which Role Assignments may - be created using this Role Definition. This will allow application of this Role Definition on - the entire database account or any underlying Database / Collection. Must have at least one - element. Scopes higher than Database account are not enforceable as assignable Scopes. Note - that resources referenced in assignable Scopes need not exist. - :vartype assignable_scopes: list[str] - :ivar permissions: The set of operations allowed through this Role Definition. - :vartype permissions: list[~azure.mgmt.cosmosdb.models.Permission] - """ - - _attribute_map = { - "role_name": {"key": "properties.roleName", "type": "str"}, - "type": {"key": "properties.type", "type": "str"}, - "assignable_scopes": {"key": "properties.assignableScopes", "type": "[str]"}, - "permissions": {"key": "properties.permissions", "type": "[Permission]"}, - } - - def __init__( - self, - *, - role_name: Optional[str] = None, - type: Optional[Union[str, "_models.RoleDefinitionType"]] = None, - assignable_scopes: Optional[List[str]] = None, - permissions: Optional[List["_models.Permission"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword role_name: A user-friendly name for the Role Definition. Must be unique for the - database account. - :paramtype role_name: str - :keyword type: Indicates whether the Role Definition was built-in or user created. Known values - are: "BuiltInRole" and "CustomRole". - :paramtype type: str or ~azure.mgmt.cosmosdb.models.RoleDefinitionType - :keyword assignable_scopes: A set of fully qualified Scopes at or below which Role Assignments - may be created using this Role Definition. This will allow application of this Role Definition - on the entire database account or any underlying Database / Collection. Must have at least one - element. Scopes higher than Database account are not enforceable as assignable Scopes. Note - that resources referenced in assignable Scopes need not exist. - :paramtype assignable_scopes: list[str] - :keyword permissions: The set of operations allowed through this Role Definition. - :paramtype permissions: list[~azure.mgmt.cosmosdb.models.Permission] - """ - super().__init__(**kwargs) - self.role_name = role_name - self.type = type - self.assignable_scopes = assignable_scopes - self.permissions = permissions - - -class SqlRoleDefinitionGetResults(ARMProxyResource): - """An Azure Cosmos DB SQL Role Definition. +class SqlDatabaseCreateUpdateParameters(ARMResourceProperties): + """Parameters to create and update Cosmos DB SQL database. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The unique resource identifier of the database account. + All required parameters must be populated in order to send to server. + + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str - :ivar name: The name of the database account. + :ivar name: The name of the ARM resource. :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar role_name: A user-friendly name for the Role Definition. Must be unique for the database - account. - :vartype role_name: str - :ivar type_properties_type: Indicates whether the Role Definition was built-in or user created. - Known values are: "BuiltInRole" and "CustomRole". - :vartype type_properties_type: str or ~azure.mgmt.cosmosdb.models.RoleDefinitionType - :ivar assignable_scopes: A set of fully qualified Scopes at or below which Role Assignments may - be created using this Role Definition. This will allow application of this Role Definition on - the entire database account or any underlying Database / Collection. Must have at least one - element. Scopes higher than Database account are not enforceable as assignable Scopes. Note - that resources referenced in assignable Scopes need not exist. - :vartype assignable_scopes: list[str] - :ivar permissions: The set of operations allowed through this Role Definition. - :vartype permissions: list[~azure.mgmt.cosmosdb.models.Permission] + :ivar type: The type of Azure resource. + :vartype type: str + :ivar location: The location of the resource group to which the resource belongs. + :vartype location: str + :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :vartype tags: dict[str, str] + :ivar resource: The standard JSON format of a SQL database. Required. + :vartype resource: ~azure.mgmt.cosmosdb.models.SqlDatabaseResource + :ivar options: A key-value pair of options to be applied for the request. This corresponds to + the headers sent with the request. + :vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "resource": {"required": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "role_name": {"key": "properties.roleName", "type": "str"}, - "type_properties_type": {"key": "properties.type", "type": "str"}, - "assignable_scopes": {"key": "properties.assignableScopes", "type": "[str]"}, - "permissions": {"key": "properties.permissions", "type": "[Permission]"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "resource": {"key": "properties.resource", "type": "SqlDatabaseResource"}, + "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, } def __init__( self, *, - role_name: Optional[str] = None, - type_properties_type: Optional[Union[str, "_models.RoleDefinitionType"]] = None, - assignable_scopes: Optional[List[str]] = None, - permissions: Optional[List["_models.Permission"]] = None, + resource: "_models.SqlDatabaseResource", + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + options: Optional["_models.CreateUpdateOptions"] = None, **kwargs: Any ) -> None: """ - :keyword role_name: A user-friendly name for the Role Definition. Must be unique for the - database account. - :paramtype role_name: str - :keyword type_properties_type: Indicates whether the Role Definition was built-in or user - created. Known values are: "BuiltInRole" and "CustomRole". - :paramtype type_properties_type: str or ~azure.mgmt.cosmosdb.models.RoleDefinitionType - :keyword assignable_scopes: A set of fully qualified Scopes at or below which Role Assignments - may be created using this Role Definition. This will allow application of this Role Definition - on the entire database account or any underlying Database / Collection. Must have at least one - element. Scopes higher than Database account are not enforceable as assignable Scopes. Note - that resources referenced in assignable Scopes need not exist. - :paramtype assignable_scopes: list[str] - :keyword permissions: The set of operations allowed through this Role Definition. - :paramtype permissions: list[~azure.mgmt.cosmosdb.models.Permission] + :keyword location: The location of the resource group to which the resource belongs. + :paramtype location: str + :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :paramtype tags: dict[str, str] + :keyword resource: The standard JSON format of a SQL database. Required. + :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlDatabaseResource + :keyword options: A key-value pair of options to be applied for the request. This corresponds + to the headers sent with the request. + :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ - super().__init__(**kwargs) - self.role_name = role_name - self.type_properties_type = type_properties_type - self.assignable_scopes = assignable_scopes - self.permissions = permissions + super().__init__(location=location, tags=tags, **kwargs) + self.resource = resource + self.options = options -class SqlRoleDefinitionListResult(_serialization.Model): - """The relevant Role Definitions. +class SqlDatabaseGetPropertiesOptions(OptionsResource): + """SqlDatabaseGetPropertiesOptions. + + :ivar throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the + ThroughputSetting resource when retrieving offer details. + :vartype throughput: int + :ivar autoscale_settings: Specifies the Autoscale settings. + :vartype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings + """ + + +class SqlDatabaseGetPropertiesResource(SqlDatabaseResource, ExtendedResourceProperties): + """SqlDatabaseGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of Role Definitions and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.SqlRoleDefinitionGetResults] + All required parameters must be populated in order to send to server. + + :ivar rid: A system generated property. A unique identifier. + :vartype rid: str + :ivar ts: A system generated property that denotes the last updated timestamp of the resource. + :vartype ts: float + :ivar etag: A system generated property representing the resource etag required for optimistic + concurrency control. + :vartype etag: str + :ivar id: Name of the Cosmos DB SQL database. Required. + :vartype id: str + :ivar restore_parameters: Parameters to indicate the information about the restore. + :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" + and "Restore". + :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :ivar colls: A system generated property that specified the addressable path of the collections + resource. + :vartype colls: str + :ivar users: A system generated property that specifies the addressable path of the users + resource. + :vartype users: str """ _validation = { - "value": {"readonly": True}, + "rid": {"readonly": True}, + "ts": {"readonly": True}, + "etag": {"readonly": True}, + "id": {"required": True}, } _attribute_map = { - "value": {"key": "value", "type": "[SqlRoleDefinitionGetResults]"}, + "rid": {"key": "_rid", "type": "str"}, + "ts": {"key": "_ts", "type": "float"}, + "etag": {"key": "_etag", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, + "create_mode": {"key": "createMode", "type": "str"}, + "colls": {"key": "_colls", "type": "str"}, + "users": {"key": "_users", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, + create_mode: Union[str, "_models.CreateMode"] = "Default", + colls: Optional[str] = None, + users: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Name of the Cosmos DB SQL database. Required. + :paramtype id: str + :keyword restore_parameters: Parameters to indicate the information about the restore. + :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: + "Default" and "Restore". + :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :keyword colls: A system generated property that specified the addressable path of the + collections resource. + :paramtype colls: str + :keyword users: A system generated property that specifies the addressable path of the users + resource. + :paramtype users: str + """ + super().__init__(id=id, restore_parameters=restore_parameters, create_mode=create_mode, **kwargs) + self.rid = None + self.ts = None + self.etag = None + self.colls = colls + self.users = users + self.id = id + self.restore_parameters = restore_parameters + self.create_mode = create_mode -class SqlStoredProcedureCreateUpdateParameters(ARMResourceProperties): - """Parameters to create and update Cosmos DB storedProcedure. +class SqlDatabaseGetResults(ARMResourceProperties): + """An Azure Cosmos DB SQL database. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to server. - :ivar id: The unique resource identifier of the ARM resource. :vartype id: str :ivar name: The name of the ARM resource. @@ -14968,20 +11498,16 @@ class SqlStoredProcedureCreateUpdateParameters(ARMResourceProperties): with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :ivar resource: The standard JSON format of a storedProcedure. Required. - :vartype resource: ~azure.mgmt.cosmosdb.models.SqlStoredProcedureResource - :ivar options: A key-value pair of options to be applied for the request. This corresponds to - the headers sent with the request. - :vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions + :ivar resource: + :vartype resource: ~azure.mgmt.cosmosdb.models.SqlDatabaseGetPropertiesResource + :ivar options: + :vartype options: ~azure.mgmt.cosmosdb.models.SqlDatabaseGetPropertiesOptions """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, - "resource": {"required": True}, } _attribute_map = { @@ -14990,19 +11516,17 @@ class SqlStoredProcedureCreateUpdateParameters(ARMResourceProperties): "type": {"key": "type", "type": "str"}, "location": {"key": "location", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "resource": {"key": "properties.resource", "type": "SqlStoredProcedureResource"}, - "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, + "resource": {"key": "properties.resource", "type": "SqlDatabaseGetPropertiesResource"}, + "options": {"key": "properties.options", "type": "SqlDatabaseGetPropertiesOptions"}, } def __init__( self, *, - resource: "_models.SqlStoredProcedureResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - options: Optional["_models.CreateUpdateOptions"] = None, + resource: Optional["_models.SqlDatabaseGetPropertiesResource"] = None, + options: Optional["_models.SqlDatabaseGetPropertiesOptions"] = None, **kwargs: Any ) -> None: """ @@ -15015,430 +11539,455 @@ def __init__( with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :keyword resource: The standard JSON format of a storedProcedure. Required. - :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlStoredProcedureResource - :keyword options: A key-value pair of options to be applied for the request. This corresponds - to the headers sent with the request. - :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions + :keyword resource: + :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlDatabaseGetPropertiesResource + :keyword options: + :paramtype options: ~azure.mgmt.cosmosdb.models.SqlDatabaseGetPropertiesOptions """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options -class SqlStoredProcedureResource(_serialization.Model): - """Cosmos DB SQL storedProcedure resource object. +class SqlDatabaseListResult(_serialization.Model): + """The List operation response, that contains the SQL databases and their properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of SQL databases and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.SqlDatabaseGetResults] + """ + + _validation = { + "value": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[SqlDatabaseGetResults]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None + + +class SqlDedicatedGatewayRegionalServiceResource(RegionalServiceResource): # pylint: disable=name-too-long + """Resource for a regional service location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The regional service name. + :vartype name: str + :ivar location: The location name. + :vartype location: str + :ivar status: Describes the status of a service. Known values are: "Creating", "Running", + "Updating", "Deleting", "Error", and "Stopped". + :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus + :ivar sql_dedicated_gateway_endpoint: The regional endpoint for SqlDedicatedGateway. + :vartype sql_dedicated_gateway_endpoint: str + """ + + _validation = { + "name": {"readonly": True}, + "location": {"readonly": True}, + "status": {"readonly": True}, + "sql_dedicated_gateway_endpoint": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "sql_dedicated_gateway_endpoint": {"key": "sqlDedicatedGatewayEndpoint", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.sql_dedicated_gateway_endpoint = None + - All required parameters must be populated in order to send to server. +class SqlDedicatedGatewayServiceResource(_serialization.Model): + """Describes the service response property for SqlDedicatedGateway. - :ivar id: Name of the Cosmos DB SQL storedProcedure. Required. - :vartype id: str - :ivar body: Body of the Stored Procedure. - :vartype body: str + :ivar properties: Properties for SqlDedicatedGatewayServiceResource. + :vartype properties: ~azure.mgmt.cosmosdb.models.SqlDedicatedGatewayServiceResourceProperties """ - _validation = { - "id": {"required": True}, - } - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "body": {"key": "body", "type": "str"}, + "properties": {"key": "properties", "type": "SqlDedicatedGatewayServiceResourceProperties"}, } def __init__( - self, *, id: str, body: Optional[str] = None, **kwargs: Any # pylint: disable=redefined-builtin + self, *, properties: Optional["_models.SqlDedicatedGatewayServiceResourceProperties"] = None, **kwargs: Any ) -> None: """ - :keyword id: Name of the Cosmos DB SQL storedProcedure. Required. - :paramtype id: str - :keyword body: Body of the Stored Procedure. - :paramtype body: str + :keyword properties: Properties for SqlDedicatedGatewayServiceResource. + :paramtype properties: ~azure.mgmt.cosmosdb.models.SqlDedicatedGatewayServiceResourceProperties """ super().__init__(**kwargs) - self.id = id - self.body = body - + self.properties = properties -class SqlStoredProcedureGetPropertiesResource(SqlStoredProcedureResource, ExtendedResourceProperties): - """SqlStoredProcedureGetPropertiesResource. - Variables are only populated by the server, and will be ignored when sending a request. +class SqlDedicatedGatewayServiceResourceCreateUpdateProperties( + ServiceResourceCreateUpdateProperties +): # pylint: disable=name-too-long + """Properties for Create or Update request for SqlDedicatedGatewayServiceResource. All required parameters must be populated in order to send to server. - :ivar rid: A system generated property. A unique identifier. - :vartype rid: str - :ivar ts: A system generated property that denotes the last updated timestamp of the resource. - :vartype ts: float - :ivar etag: A system generated property representing the resource etag required for optimistic - concurrency control. - :vartype etag: str - :ivar id: Name of the Cosmos DB SQL storedProcedure. Required. - :vartype id: str - :ivar body: Body of the Stored Procedure. - :vartype body: str + :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", + "Cosmos.D8s", and "Cosmos.D16s". + :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :ivar instance_count: Instance count for the service. + :vartype instance_count: int + :ivar service_type: ServiceType for the service. Required. Known values are: + "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". + :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType + :ivar dedicated_gateway_type: DedicatedGatewayType for the service. Known values are: + "IntegratedCache" and "DistributedQuery". + :vartype dedicated_gateway_type: str or ~azure.mgmt.cosmosdb.models.DedicatedGatewayType """ _validation = { - "rid": {"readonly": True}, - "ts": {"readonly": True}, - "etag": {"readonly": True}, - "id": {"required": True}, + "instance_count": {"minimum": 0}, + "service_type": {"required": True}, } _attribute_map = { - "rid": {"key": "_rid", "type": "str"}, - "ts": {"key": "_ts", "type": "float"}, - "etag": {"key": "_etag", "type": "str"}, - "id": {"key": "id", "type": "str"}, - "body": {"key": "body", "type": "str"}, + "instance_size": {"key": "instanceSize", "type": "str"}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "service_type": {"key": "serviceType", "type": "str"}, + "dedicated_gateway_type": {"key": "dedicatedGatewayType", "type": "str"}, } def __init__( - self, *, id: str, body: Optional[str] = None, **kwargs: Any # pylint: disable=redefined-builtin + self, + *, + instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, + instance_count: Optional[int] = None, + dedicated_gateway_type: Optional[Union[str, "_models.DedicatedGatewayType"]] = None, + **kwargs: Any ) -> None: """ - :keyword id: Name of the Cosmos DB SQL storedProcedure. Required. - :paramtype id: str - :keyword body: Body of the Stored Procedure. - :paramtype body: str + :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", + "Cosmos.D8s", and "Cosmos.D16s". + :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :keyword instance_count: Instance count for the service. + :paramtype instance_count: int + :keyword dedicated_gateway_type: DedicatedGatewayType for the service. Known values are: + "IntegratedCache" and "DistributedQuery". + :paramtype dedicated_gateway_type: str or ~azure.mgmt.cosmosdb.models.DedicatedGatewayType """ - super().__init__(id=id, body=body, **kwargs) - self.rid = None - self.ts = None - self.etag = None - self.id = id - self.body = body + super().__init__(instance_size=instance_size, instance_count=instance_count, **kwargs) + self.service_type: str = "SqlDedicatedGateway" + self.dedicated_gateway_type = dedicated_gateway_type -class SqlStoredProcedureGetResults(ARMResourceProperties): - """An Azure Cosmos DB storedProcedure. +class SqlDedicatedGatewayServiceResourceProperties(ServiceResourceProperties): # pylint: disable=name-too-long + """Properties for SqlDedicatedGatewayServiceResource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The unique resource identifier of the ARM resource. - :vartype id: str - :ivar name: The name of the ARM resource. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar location: The location of the resource group to which the resource belongs. - :vartype location: str - :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :ivar resource: - :vartype resource: ~azure.mgmt.cosmosdb.models.SqlStoredProcedureGetPropertiesResource + All required parameters must be populated in order to send to server. + + :ivar additional_properties: Unmatched properties from the message are deserialized to this + collection. + :vartype additional_properties: dict[str, any] + :ivar creation_time: Time of the last state change (ISO-8601 format). + :vartype creation_time: ~datetime.datetime + :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", + "Cosmos.D8s", and "Cosmos.D16s". + :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :ivar instance_count: Instance count for the service. + :vartype instance_count: int + :ivar service_type: ServiceType for the service. Required. Known values are: + "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". + :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType + :ivar status: Describes the status of a service. Known values are: "Creating", "Running", + "Updating", "Deleting", "Error", and "Stopped". + :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus + :ivar sql_dedicated_gateway_endpoint: SqlDedicatedGateway endpoint for the service. + :vartype sql_dedicated_gateway_endpoint: str + :ivar dedicated_gateway_type: DedicatedGatewayType for the service. Known values are: + "IntegratedCache" and "DistributedQuery". + :vartype dedicated_gateway_type: str or ~azure.mgmt.cosmosdb.models.DedicatedGatewayType + :ivar locations: An array that contains all of the locations for the service. + :vartype locations: + list[~azure.mgmt.cosmosdb.models.SqlDedicatedGatewayRegionalServiceResource] """ _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, + "creation_time": {"readonly": True}, + "instance_count": {"minimum": 0}, + "service_type": {"required": True}, + "status": {"readonly": True}, + "locations": {"readonly": True}, } _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "resource": {"key": "properties.resource", "type": "SqlStoredProcedureGetPropertiesResource"}, + "additional_properties": {"key": "", "type": "{object}"}, + "creation_time": {"key": "creationTime", "type": "iso-8601"}, + "instance_size": {"key": "instanceSize", "type": "str"}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "service_type": {"key": "serviceType", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "sql_dedicated_gateway_endpoint": {"key": "sqlDedicatedGatewayEndpoint", "type": "str"}, + "dedicated_gateway_type": {"key": "dedicatedGatewayType", "type": "str"}, + "locations": {"key": "locations", "type": "[SqlDedicatedGatewayRegionalServiceResource]"}, } def __init__( self, *, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - resource: Optional["_models.SqlStoredProcedureGetPropertiesResource"] = None, + additional_properties: Optional[Dict[str, Any]] = None, + instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, + instance_count: Optional[int] = None, + sql_dedicated_gateway_endpoint: Optional[str] = None, + dedicated_gateway_type: Optional[Union[str, "_models.DedicatedGatewayType"]] = None, **kwargs: Any ) -> None: """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :keyword resource: - :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlStoredProcedureGetPropertiesResource + :keyword additional_properties: Unmatched properties from the message are deserialized to this + collection. + :paramtype additional_properties: dict[str, any] + :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", + "Cosmos.D8s", and "Cosmos.D16s". + :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :keyword instance_count: Instance count for the service. + :paramtype instance_count: int + :keyword sql_dedicated_gateway_endpoint: SqlDedicatedGateway endpoint for the service. + :paramtype sql_dedicated_gateway_endpoint: str + :keyword dedicated_gateway_type: DedicatedGatewayType for the service. Known values are: + "IntegratedCache" and "DistributedQuery". + :paramtype dedicated_gateway_type: str or ~azure.mgmt.cosmosdb.models.DedicatedGatewayType """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.resource = resource - + super().__init__( + additional_properties=additional_properties, + instance_size=instance_size, + instance_count=instance_count, + **kwargs + ) + self.service_type: str = "SqlDedicatedGateway" + self.sql_dedicated_gateway_endpoint = sql_dedicated_gateway_endpoint + self.dedicated_gateway_type = dedicated_gateway_type + self.locations = None -class SqlStoredProcedureListResult(_serialization.Model): - """The List operation response, that contains the storedProcedures and their properties. - Variables are only populated by the server, and will be ignored when sending a request. +class SqlRoleAssignmentCreateUpdateParameters(_serialization.Model): + """Parameters to create and update an Azure Cosmos DB SQL Role Assignment. - :ivar value: List of storedProcedures and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.SqlStoredProcedureGetResults] + :ivar role_definition_id: The unique identifier for the associated Role Definition. + :vartype role_definition_id: str + :ivar scope: The data plane resource path for which access is being granted through this Role + Assignment. + :vartype scope: str + :ivar principal_id: The unique identifier for the associated AAD principal in the AAD graph to + which access is being granted through this Role Assignment. Tenant ID for the principal is + inferred using the tenant associated with the subscription. + :vartype principal_id: str """ - _validation = { - "value": {"readonly": True}, - } - _attribute_map = { - "value": {"key": "value", "type": "[SqlStoredProcedureGetResults]"}, + "role_definition_id": {"key": "properties.roleDefinitionId", "type": "str"}, + "scope": {"key": "properties.scope", "type": "str"}, + "principal_id": {"key": "properties.principalId", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + role_definition_id: Optional[str] = None, + scope: Optional[str] = None, + principal_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword role_definition_id: The unique identifier for the associated Role Definition. + :paramtype role_definition_id: str + :keyword scope: The data plane resource path for which access is being granted through this + Role Assignment. + :paramtype scope: str + :keyword principal_id: The unique identifier for the associated AAD principal in the AAD graph + to which access is being granted through this Role Assignment. Tenant ID for the principal is + inferred using the tenant associated with the subscription. + :paramtype principal_id: str + """ super().__init__(**kwargs) - self.value = None + self.role_definition_id = role_definition_id + self.scope = scope + self.principal_id = principal_id -class SqlTriggerCreateUpdateParameters(ARMResourceProperties): - """Parameters to create and update Cosmos DB trigger. +class SqlRoleAssignmentGetResults(ARMProxyResource): + """An Azure Cosmos DB Role Assignment. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to server. - - :ivar id: The unique resource identifier of the ARM resource. + :ivar id: The unique resource identifier of the database account. :vartype id: str - :ivar name: The name of the ARM resource. + :ivar name: The name of the database account. :vartype name: str :ivar type: The type of Azure resource. :vartype type: str - :ivar location: The location of the resource group to which the resource belongs. - :vartype location: str - :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :ivar resource: The standard JSON format of a trigger. Required. - :vartype resource: ~azure.mgmt.cosmosdb.models.SqlTriggerResource - :ivar options: A key-value pair of options to be applied for the request. This corresponds to - the headers sent with the request. - :vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions + :ivar role_definition_id: The unique identifier for the associated Role Definition. + :vartype role_definition_id: str + :ivar scope: The data plane resource path for which access is being granted through this Role + Assignment. + :vartype scope: str + :ivar principal_id: The unique identifier for the associated AAD principal in the AAD graph to + which access is being granted through this Role Assignment. Tenant ID for the principal is + inferred using the tenant associated with the subscription. + :vartype principal_id: str """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, - "resource": {"required": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "resource": {"key": "properties.resource", "type": "SqlTriggerResource"}, - "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, + "role_definition_id": {"key": "properties.roleDefinitionId", "type": "str"}, + "scope": {"key": "properties.scope", "type": "str"}, + "principal_id": {"key": "properties.principalId", "type": "str"}, } def __init__( self, *, - resource: "_models.SqlTriggerResource", - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - options: Optional["_models.CreateUpdateOptions"] = None, + role_definition_id: Optional[str] = None, + scope: Optional[str] = None, + principal_id: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :keyword resource: The standard JSON format of a trigger. Required. - :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlTriggerResource - :keyword options: A key-value pair of options to be applied for the request. This corresponds - to the headers sent with the request. - :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions + :keyword role_definition_id: The unique identifier for the associated Role Definition. + :paramtype role_definition_id: str + :keyword scope: The data plane resource path for which access is being granted through this + Role Assignment. + :paramtype scope: str + :keyword principal_id: The unique identifier for the associated AAD principal in the AAD graph + to which access is being granted through this Role Assignment. Tenant ID for the principal is + inferred using the tenant associated with the subscription. + :paramtype principal_id: str """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.resource = resource - self.options = options + super().__init__(**kwargs) + self.role_definition_id = role_definition_id + self.scope = scope + self.principal_id = principal_id -class SqlTriggerResource(_serialization.Model): - """Cosmos DB SQL trigger resource object. +class SqlRoleAssignmentListResult(_serialization.Model): + """The relevant Role Assignments. - All required parameters must be populated in order to send to server. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Name of the Cosmos DB SQL trigger. Required. - :vartype id: str - :ivar body: Body of the Trigger. - :vartype body: str - :ivar trigger_type: Type of the Trigger. Known values are: "Pre" and "Post". - :vartype trigger_type: str or ~azure.mgmt.cosmosdb.models.TriggerType - :ivar trigger_operation: The operation the trigger is associated with. Known values are: "All", - "Create", "Update", "Delete", and "Replace". - :vartype trigger_operation: str or ~azure.mgmt.cosmosdb.models.TriggerOperation + :ivar value: List of Role Assignments and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.SqlRoleAssignmentGetResults] """ _validation = { - "id": {"required": True}, + "value": {"readonly": True}, } _attribute_map = { - "id": {"key": "id", "type": "str"}, - "body": {"key": "body", "type": "str"}, - "trigger_type": {"key": "triggerType", "type": "str"}, - "trigger_operation": {"key": "triggerOperation", "type": "str"}, + "value": {"key": "value", "type": "[SqlRoleAssignmentGetResults]"}, } - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - body: Optional[str] = None, - trigger_type: Optional[Union[str, "_models.TriggerType"]] = None, - trigger_operation: Optional[Union[str, "_models.TriggerOperation"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword id: Name of the Cosmos DB SQL trigger. Required. - :paramtype id: str - :keyword body: Body of the Trigger. - :paramtype body: str - :keyword trigger_type: Type of the Trigger. Known values are: "Pre" and "Post". - :paramtype trigger_type: str or ~azure.mgmt.cosmosdb.models.TriggerType - :keyword trigger_operation: The operation the trigger is associated with. Known values are: - "All", "Create", "Update", "Delete", and "Replace". - :paramtype trigger_operation: str or ~azure.mgmt.cosmosdb.models.TriggerOperation - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.id = id - self.body = body - self.trigger_type = trigger_type - self.trigger_operation = trigger_operation - - -class SqlTriggerGetPropertiesResource(SqlTriggerResource, ExtendedResourceProperties): - """SqlTriggerGetPropertiesResource. + self.value = None - 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. +class SqlRoleDefinitionCreateUpdateParameters(_serialization.Model): + """Parameters to create and update an Azure Cosmos DB SQL Role Definition. - :ivar rid: A system generated property. A unique identifier. - :vartype rid: str - :ivar ts: A system generated property that denotes the last updated timestamp of the resource. - :vartype ts: float - :ivar etag: A system generated property representing the resource etag required for optimistic - concurrency control. - :vartype etag: str - :ivar id: Name of the Cosmos DB SQL trigger. Required. - :vartype id: str - :ivar body: Body of the Trigger. - :vartype body: str - :ivar trigger_type: Type of the Trigger. Known values are: "Pre" and "Post". - :vartype trigger_type: str or ~azure.mgmt.cosmosdb.models.TriggerType - :ivar trigger_operation: The operation the trigger is associated with. Known values are: "All", - "Create", "Update", "Delete", and "Replace". - :vartype trigger_operation: str or ~azure.mgmt.cosmosdb.models.TriggerOperation + :ivar role_name: A user-friendly name for the Role Definition. Must be unique for the database + account. + :vartype role_name: str + :ivar type: Indicates whether the Role Definition was built-in or user created. Known values + are: "BuiltInRole" and "CustomRole". + :vartype type: str or ~azure.mgmt.cosmosdb.models.RoleDefinitionType + :ivar assignable_scopes: A set of fully qualified Scopes at or below which Role Assignments may + be created using this Role Definition. This will allow application of this Role Definition on + the entire database account or any underlying Database / Collection. Must have at least one + element. Scopes higher than Database account are not enforceable as assignable Scopes. Note + that resources referenced in assignable Scopes need not exist. + :vartype assignable_scopes: list[str] + :ivar permissions: The set of operations allowed through this Role Definition. + :vartype permissions: list[~azure.mgmt.cosmosdb.models.Permission] """ - _validation = { - "rid": {"readonly": True}, - "ts": {"readonly": True}, - "etag": {"readonly": True}, - "id": {"required": True}, - } - _attribute_map = { - "rid": {"key": "_rid", "type": "str"}, - "ts": {"key": "_ts", "type": "float"}, - "etag": {"key": "_etag", "type": "str"}, - "id": {"key": "id", "type": "str"}, - "body": {"key": "body", "type": "str"}, - "trigger_type": {"key": "triggerType", "type": "str"}, - "trigger_operation": {"key": "triggerOperation", "type": "str"}, + "role_name": {"key": "properties.roleName", "type": "str"}, + "type": {"key": "properties.type", "type": "str"}, + "assignable_scopes": {"key": "properties.assignableScopes", "type": "[str]"}, + "permissions": {"key": "properties.permissions", "type": "[Permission]"}, } def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - body: Optional[str] = None, - trigger_type: Optional[Union[str, "_models.TriggerType"]] = None, - trigger_operation: Optional[Union[str, "_models.TriggerOperation"]] = None, + role_name: Optional[str] = None, + type: Optional[Union[str, "_models.RoleDefinitionType"]] = None, + assignable_scopes: Optional[List[str]] = None, + permissions: Optional[List["_models.Permission"]] = None, **kwargs: Any ) -> None: """ - :keyword id: Name of the Cosmos DB SQL trigger. Required. - :paramtype id: str - :keyword body: Body of the Trigger. - :paramtype body: str - :keyword trigger_type: Type of the Trigger. Known values are: "Pre" and "Post". - :paramtype trigger_type: str or ~azure.mgmt.cosmosdb.models.TriggerType - :keyword trigger_operation: The operation the trigger is associated with. Known values are: - "All", "Create", "Update", "Delete", and "Replace". - :paramtype trigger_operation: str or ~azure.mgmt.cosmosdb.models.TriggerOperation + :keyword role_name: A user-friendly name for the Role Definition. Must be unique for the + database account. + :paramtype role_name: str + :keyword type: Indicates whether the Role Definition was built-in or user created. Known values + are: "BuiltInRole" and "CustomRole". + :paramtype type: str or ~azure.mgmt.cosmosdb.models.RoleDefinitionType + :keyword assignable_scopes: A set of fully qualified Scopes at or below which Role Assignments + may be created using this Role Definition. This will allow application of this Role Definition + on the entire database account or any underlying Database / Collection. Must have at least one + element. Scopes higher than Database account are not enforceable as assignable Scopes. Note + that resources referenced in assignable Scopes need not exist. + :paramtype assignable_scopes: list[str] + :keyword permissions: The set of operations allowed through this Role Definition. + :paramtype permissions: list[~azure.mgmt.cosmosdb.models.Permission] """ - super().__init__(id=id, body=body, trigger_type=trigger_type, trigger_operation=trigger_operation, **kwargs) - self.rid = None - self.ts = None - self.etag = None - self.id = id - self.body = body - self.trigger_type = trigger_type - self.trigger_operation = trigger_operation + super().__init__(**kwargs) + self.role_name = role_name + self.type = type + self.assignable_scopes = assignable_scopes + self.permissions = permissions -class SqlTriggerGetResults(ARMResourceProperties): - """An Azure Cosmos DB trigger. +class SqlRoleDefinitionGetResults(ARMProxyResource): + """An Azure Cosmos DB SQL Role Definition. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The unique resource identifier of the ARM resource. + :ivar id: The unique resource identifier of the database account. :vartype id: str - :ivar name: The name of the ARM resource. + :ivar name: The name of the database account. :vartype name: str :ivar type: The type of Azure resource. :vartype type: str - :ivar location: The location of the resource group to which the resource belongs. - :vartype location: str - :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :ivar resource: - :vartype resource: ~azure.mgmt.cosmosdb.models.SqlTriggerGetPropertiesResource + :ivar role_name: A user-friendly name for the Role Definition. Must be unique for the database + account. + :vartype role_name: str + :ivar type_properties_type: Indicates whether the Role Definition was built-in or user created. + Known values are: "BuiltInRole" and "CustomRole". + :vartype type_properties_type: str or ~azure.mgmt.cosmosdb.models.RoleDefinitionType + :ivar assignable_scopes: A set of fully qualified Scopes at or below which Role Assignments may + be created using this Role Definition. This will allow application of this Role Definition on + the entire database account or any underlying Database / Collection. Must have at least one + element. Scopes higher than Database account are not enforceable as assignable Scopes. Note + that resources referenced in assignable Scopes need not exist. + :vartype assignable_scopes: list[str] + :ivar permissions: The set of operations allowed through this Role Definition. + :vartype permissions: list[~azure.mgmt.cosmosdb.models.Permission] """ _validation = { @@ -15451,47 +12000,51 @@ class SqlTriggerGetResults(ARMResourceProperties): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "resource": {"key": "properties.resource", "type": "SqlTriggerGetPropertiesResource"}, + "role_name": {"key": "properties.roleName", "type": "str"}, + "type_properties_type": {"key": "properties.type", "type": "str"}, + "assignable_scopes": {"key": "properties.assignableScopes", "type": "[str]"}, + "permissions": {"key": "properties.permissions", "type": "[Permission]"}, } def __init__( self, *, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - resource: Optional["_models.SqlTriggerGetPropertiesResource"] = None, + role_name: Optional[str] = None, + type_properties_type: Optional[Union[str, "_models.RoleDefinitionType"]] = None, + assignable_scopes: Optional[List[str]] = None, + permissions: Optional[List["_models.Permission"]] = None, **kwargs: Any ) -> None: """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be - used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can - be provided for a resource. Each tag must have a key no greater than 128 characters and value - no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :keyword resource: - :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlTriggerGetPropertiesResource + :keyword role_name: A user-friendly name for the Role Definition. Must be unique for the + database account. + :paramtype role_name: str + :keyword type_properties_type: Indicates whether the Role Definition was built-in or user + created. Known values are: "BuiltInRole" and "CustomRole". + :paramtype type_properties_type: str or ~azure.mgmt.cosmosdb.models.RoleDefinitionType + :keyword assignable_scopes: A set of fully qualified Scopes at or below which Role Assignments + may be created using this Role Definition. This will allow application of this Role Definition + on the entire database account or any underlying Database / Collection. Must have at least one + element. Scopes higher than Database account are not enforceable as assignable Scopes. Note + that resources referenced in assignable Scopes need not exist. + :paramtype assignable_scopes: list[str] + :keyword permissions: The set of operations allowed through this Role Definition. + :paramtype permissions: list[~azure.mgmt.cosmosdb.models.Permission] """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.resource = resource + super().__init__(**kwargs) + self.role_name = role_name + self.type_properties_type = type_properties_type + self.assignable_scopes = assignable_scopes + self.permissions = permissions -class SqlTriggerListResult(_serialization.Model): - """The List operation response, that contains the triggers and their properties. +class SqlRoleDefinitionListResult(_serialization.Model): + """The relevant Role Definitions. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of triggers and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.SqlTriggerGetResults] + :ivar value: List of Role Definitions and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.SqlRoleDefinitionGetResults] """ _validation = { @@ -15499,7 +12052,7 @@ class SqlTriggerListResult(_serialization.Model): } _attribute_map = { - "value": {"key": "value", "type": "[SqlTriggerGetResults]"}, + "value": {"key": "value", "type": "[SqlRoleDefinitionGetResults]"}, } def __init__(self, **kwargs: Any) -> None: @@ -15508,8 +12061,8 @@ def __init__(self, **kwargs: Any) -> None: self.value = None -class SqlUserDefinedFunctionCreateUpdateParameters(ARMResourceProperties): # pylint: disable=name-too-long - """Parameters to create and update Cosmos DB userDefinedFunction. +class SqlStoredProcedureCreateUpdateParameters(ARMResourceProperties): + """Parameters to create and update Cosmos DB storedProcedure. Variables are only populated by the server, and will be ignored when sending a request. @@ -15530,10 +12083,8 @@ class SqlUserDefinedFunctionCreateUpdateParameters(ARMResourceProperties): # py with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :ivar resource: The standard JSON format of a userDefinedFunction. Required. - :vartype resource: ~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionResource + :ivar resource: The standard JSON format of a storedProcedure. Required. + :vartype resource: ~azure.mgmt.cosmosdb.models.SqlStoredProcedureResource :ivar options: A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. :vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions @@ -15552,18 +12103,16 @@ class SqlUserDefinedFunctionCreateUpdateParameters(ARMResourceProperties): # py "type": {"key": "type", "type": "str"}, "location": {"key": "location", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "resource": {"key": "properties.resource", "type": "SqlUserDefinedFunctionResource"}, + "resource": {"key": "properties.resource", "type": "SqlStoredProcedureResource"}, "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, } def __init__( self, *, - resource: "_models.SqlUserDefinedFunctionResource", + resource: "_models.SqlStoredProcedureResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, **kwargs: Any ) -> None: @@ -15577,27 +12126,25 @@ def __init__( with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :keyword resource: The standard JSON format of a userDefinedFunction. Required. - :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionResource + :keyword resource: The standard JSON format of a storedProcedure. Required. + :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlStoredProcedureResource :keyword options: A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options -class SqlUserDefinedFunctionResource(_serialization.Model): - """Cosmos DB SQL userDefinedFunction resource object. +class SqlStoredProcedureResource(_serialization.Model): + """Cosmos DB SQL storedProcedure resource object. All required parameters must be populated in order to send to server. - :ivar id: Name of the Cosmos DB SQL userDefinedFunction. Required. + :ivar id: Name of the Cosmos DB SQL storedProcedure. Required. :vartype id: str - :ivar body: Body of the User Defined Function. + :ivar body: Body of the Stored Procedure. :vartype body: str """ @@ -15614,9 +12161,9 @@ def __init__( self, *, id: str, body: Optional[str] = None, **kwargs: Any # pylint: disable=redefined-builtin ) -> None: """ - :keyword id: Name of the Cosmos DB SQL userDefinedFunction. Required. + :keyword id: Name of the Cosmos DB SQL storedProcedure. Required. :paramtype id: str - :keyword body: Body of the User Defined Function. + :keyword body: Body of the Stored Procedure. :paramtype body: str """ super().__init__(**kwargs) @@ -15624,10 +12171,8 @@ def __init__( self.body = body -class SqlUserDefinedFunctionGetPropertiesResource( - SqlUserDefinedFunctionResource, ExtendedResourceProperties -): # pylint: disable=name-too-long - """SqlUserDefinedFunctionGetPropertiesResource. +class SqlStoredProcedureGetPropertiesResource(SqlStoredProcedureResource, ExtendedResourceProperties): + """SqlStoredProcedureGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. @@ -15640,9 +12185,9 @@ class SqlUserDefinedFunctionGetPropertiesResource( :ivar etag: A system generated property representing the resource etag required for optimistic concurrency control. :vartype etag: str - :ivar id: Name of the Cosmos DB SQL userDefinedFunction. Required. + :ivar id: Name of the Cosmos DB SQL storedProcedure. Required. :vartype id: str - :ivar body: Body of the User Defined Function. + :ivar body: Body of the Stored Procedure. :vartype body: str """ @@ -15665,9 +12210,9 @@ def __init__( self, *, id: str, body: Optional[str] = None, **kwargs: Any # pylint: disable=redefined-builtin ) -> None: """ - :keyword id: Name of the Cosmos DB SQL userDefinedFunction. Required. + :keyword id: Name of the Cosmos DB SQL storedProcedure. Required. :paramtype id: str - :keyword body: Body of the User Defined Function. + :keyword body: Body of the Stored Procedure. :paramtype body: str """ super().__init__(id=id, body=body, **kwargs) @@ -15678,8 +12223,8 @@ def __init__( self.body = body -class SqlUserDefinedFunctionGetResults(ARMResourceProperties): - """An Azure Cosmos DB userDefinedFunction. +class SqlStoredProcedureGetResults(ARMResourceProperties): + """An Azure Cosmos DB storedProcedure. Variables are only populated by the server, and will be ignored when sending a request. @@ -15698,10 +12243,8 @@ class SqlUserDefinedFunctionGetResults(ARMResourceProperties): with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :ivar resource: - :vartype resource: ~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionGetPropertiesResource + :vartype resource: ~azure.mgmt.cosmosdb.models.SqlStoredProcedureGetPropertiesResource """ _validation = { @@ -15716,8 +12259,7 @@ class SqlUserDefinedFunctionGetResults(ARMResourceProperties): "type": {"key": "type", "type": "str"}, "location": {"key": "location", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "resource": {"key": "properties.resource", "type": "SqlUserDefinedFunctionGetPropertiesResource"}, + "resource": {"key": "properties.resource", "type": "SqlStoredProcedureGetPropertiesResource"}, } def __init__( @@ -15725,8 +12267,7 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - resource: Optional["_models.SqlUserDefinedFunctionGetPropertiesResource"] = None, + resource: Optional["_models.SqlStoredProcedureGetPropertiesResource"] = None, **kwargs: Any ) -> None: """ @@ -15739,22 +12280,20 @@ def __init__( with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :keyword resource: - :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionGetPropertiesResource + :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlStoredProcedureGetPropertiesResource """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource -class SqlUserDefinedFunctionListResult(_serialization.Model): - """The List operation response, that contains the userDefinedFunctions and their properties. +class SqlStoredProcedureListResult(_serialization.Model): + """The List operation response, that contains the storedProcedures and their properties. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of userDefinedFunctions and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionGetResults] + :ivar value: List of storedProcedures and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.SqlStoredProcedureGetResults] """ _validation = { @@ -15762,7 +12301,7 @@ class SqlUserDefinedFunctionListResult(_serialization.Model): } _attribute_map = { - "value": {"key": "value", "type": "[SqlUserDefinedFunctionGetResults]"}, + "value": {"key": "value", "type": "[SqlStoredProcedureGetResults]"}, } def __init__(self, **kwargs: Any) -> None: @@ -15771,72 +12310,8 @@ def __init__(self, **kwargs: Any) -> None: self.value = None -class SystemData(_serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", and "Key". - :vartype created_by_type: str or ~azure.mgmt.cosmosdb.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.cosmosdb.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.cosmosdb.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.cosmosdb.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 TableCreateUpdateParameters(ARMResourceProperties): - """Parameters to create and update Cosmos DB Table. +class SqlTriggerCreateUpdateParameters(ARMResourceProperties): + """Parameters to create and update Cosmos DB trigger. Variables are only populated by the server, and will be ignored when sending a request. @@ -15857,10 +12332,8 @@ class TableCreateUpdateParameters(ARMResourceProperties): with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :ivar resource: The standard JSON format of a Table. Required. - :vartype resource: ~azure.mgmt.cosmosdb.models.TableResource + :ivar resource: The standard JSON format of a trigger. Required. + :vartype resource: ~azure.mgmt.cosmosdb.models.SqlTriggerResource :ivar options: A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. :vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions @@ -15879,18 +12352,16 @@ class TableCreateUpdateParameters(ARMResourceProperties): "type": {"key": "type", "type": "str"}, "location": {"key": "location", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "resource": {"key": "properties.resource", "type": "TableResource"}, + "resource": {"key": "properties.resource", "type": "SqlTriggerResource"}, "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, } def __init__( self, *, - resource: "_models.TableResource", + resource: "_models.SqlTriggerResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, **kwargs: Any ) -> None: @@ -15901,45 +12372,34 @@ def __init__( used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, the default experience for a template type is set - with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", - "Graph", "DocumentDB", and "MongoDB". - :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :keyword resource: The standard JSON format of a Table. Required. - :paramtype resource: ~azure.mgmt.cosmosdb.models.TableResource + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :paramtype tags: dict[str, str] + :keyword resource: The standard JSON format of a trigger. Required. + :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlTriggerResource :keyword options: A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options -class TableGetPropertiesOptions(OptionsResource): - """TableGetPropertiesOptions. - - :ivar throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the - ThroughputSetting resource when retrieving offer details. - :vartype throughput: int - :ivar autoscale_settings: Specifies the Autoscale settings. - :vartype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings - """ - - -class TableResource(_serialization.Model): - """Cosmos DB table resource object. +class SqlTriggerResource(_serialization.Model): + """Cosmos DB SQL trigger resource object. All required parameters must be populated in order to send to server. - :ivar id: Name of the Cosmos DB table. Required. + :ivar id: Name of the Cosmos DB SQL trigger. Required. :vartype id: str - :ivar restore_parameters: Parameters to indicate the information about the restore. - :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" - and "Restore". - :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :ivar body: Body of the Trigger. + :vartype body: str + :ivar trigger_type: Type of the Trigger. Known values are: "Pre" and "Post". + :vartype trigger_type: str or ~azure.mgmt.cosmosdb.models.TriggerType + :ivar trigger_operation: The operation the trigger is associated with. Known values are: "All", + "Create", "Update", "Delete", and "Replace". + :vartype trigger_operation: str or ~azure.mgmt.cosmosdb.models.TriggerOperation """ _validation = { @@ -15948,35 +12408,40 @@ class TableResource(_serialization.Model): _attribute_map = { "id": {"key": "id", "type": "str"}, - "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, - "create_mode": {"key": "createMode", "type": "str"}, + "body": {"key": "body", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "trigger_operation": {"key": "triggerOperation", "type": "str"}, } def __init__( self, *, id: str, # pylint: disable=redefined-builtin - restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, - create_mode: Union[str, "_models.CreateMode"] = "Default", + body: Optional[str] = None, + trigger_type: Optional[Union[str, "_models.TriggerType"]] = None, + trigger_operation: Optional[Union[str, "_models.TriggerOperation"]] = None, **kwargs: Any ) -> None: """ - :keyword id: Name of the Cosmos DB table. Required. + :keyword id: Name of the Cosmos DB SQL trigger. Required. :paramtype id: str - :keyword restore_parameters: Parameters to indicate the information about the restore. - :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: - "Default" and "Restore". - :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :keyword body: Body of the Trigger. + :paramtype body: str + :keyword trigger_type: Type of the Trigger. Known values are: "Pre" and "Post". + :paramtype trigger_type: str or ~azure.mgmt.cosmosdb.models.TriggerType + :keyword trigger_operation: The operation the trigger is associated with. Known values are: + "All", "Create", "Update", "Delete", and "Replace". + :paramtype trigger_operation: str or ~azure.mgmt.cosmosdb.models.TriggerOperation """ super().__init__(**kwargs) self.id = id - self.restore_parameters = restore_parameters - self.create_mode = create_mode + self.body = body + self.trigger_type = trigger_type + self.trigger_operation = trigger_operation -class TableGetPropertiesResource(TableResource, ExtendedResourceProperties): - """TableGetPropertiesResource. +class SqlTriggerGetPropertiesResource(SqlTriggerResource, ExtendedResourceProperties): + """SqlTriggerGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. @@ -15989,13 +12454,15 @@ class TableGetPropertiesResource(TableResource, ExtendedResourceProperties): :ivar etag: A system generated property representing the resource etag required for optimistic concurrency control. :vartype etag: str - :ivar id: Name of the Cosmos DB table. Required. + :ivar id: Name of the Cosmos DB SQL trigger. Required. :vartype id: str - :ivar restore_parameters: Parameters to indicate the information about the restore. - :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" - and "Restore". - :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :ivar body: Body of the Trigger. + :vartype body: str + :ivar trigger_type: Type of the Trigger. Known values are: "Pre" and "Post". + :vartype trigger_type: str or ~azure.mgmt.cosmosdb.models.TriggerType + :ivar trigger_operation: The operation the trigger is associated with. Known values are: "All", + "Create", "Update", "Delete", and "Replace". + :vartype trigger_operation: str or ~azure.mgmt.cosmosdb.models.TriggerOperation """ _validation = { @@ -16010,38 +12477,43 @@ class TableGetPropertiesResource(TableResource, ExtendedResourceProperties): "ts": {"key": "_ts", "type": "float"}, "etag": {"key": "_etag", "type": "str"}, "id": {"key": "id", "type": "str"}, - "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, - "create_mode": {"key": "createMode", "type": "str"}, + "body": {"key": "body", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "trigger_operation": {"key": "triggerOperation", "type": "str"}, } def __init__( self, *, id: str, # pylint: disable=redefined-builtin - restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, - create_mode: Union[str, "_models.CreateMode"] = "Default", + body: Optional[str] = None, + trigger_type: Optional[Union[str, "_models.TriggerType"]] = None, + trigger_operation: Optional[Union[str, "_models.TriggerOperation"]] = None, **kwargs: Any ) -> None: """ - :keyword id: Name of the Cosmos DB table. Required. + :keyword id: Name of the Cosmos DB SQL trigger. Required. :paramtype id: str - :keyword restore_parameters: Parameters to indicate the information about the restore. - :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: - "Default" and "Restore". - :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :keyword body: Body of the Trigger. + :paramtype body: str + :keyword trigger_type: Type of the Trigger. Known values are: "Pre" and "Post". + :paramtype trigger_type: str or ~azure.mgmt.cosmosdb.models.TriggerType + :keyword trigger_operation: The operation the trigger is associated with. Known values are: + "All", "Create", "Update", "Delete", and "Replace". + :paramtype trigger_operation: str or ~azure.mgmt.cosmosdb.models.TriggerOperation """ - super().__init__(id=id, restore_parameters=restore_parameters, create_mode=create_mode, **kwargs) + super().__init__(id=id, body=body, trigger_type=trigger_type, trigger_operation=trigger_operation, **kwargs) self.rid = None self.ts = None self.etag = None self.id = id - self.restore_parameters = restore_parameters - self.create_mode = create_mode + self.body = body + self.trigger_type = trigger_type + self.trigger_operation = trigger_operation -class TableGetResults(ARMResourceProperties): - """An Azure Cosmos DB Table. +class SqlTriggerGetResults(ARMResourceProperties): + """An Azure Cosmos DB trigger. Variables are only populated by the server, and will be ignored when sending a request. @@ -16060,12 +12532,8 @@ class TableGetResults(ARMResourceProperties): with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :ivar resource: - :vartype resource: ~azure.mgmt.cosmosdb.models.TableGetPropertiesResource - :ivar options: - :vartype options: ~azure.mgmt.cosmosdb.models.TableGetPropertiesOptions + :vartype resource: ~azure.mgmt.cosmosdb.models.SqlTriggerGetPropertiesResource """ _validation = { @@ -16080,9 +12548,7 @@ class TableGetResults(ARMResourceProperties): "type": {"key": "type", "type": "str"}, "location": {"key": "location", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "resource": {"key": "properties.resource", "type": "TableGetPropertiesResource"}, - "options": {"key": "properties.options", "type": "TableGetPropertiesOptions"}, + "resource": {"key": "properties.resource", "type": "SqlTriggerGetPropertiesResource"}, } def __init__( @@ -16090,9 +12556,7 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - resource: Optional["_models.TableGetPropertiesResource"] = None, - options: Optional["_models.TableGetPropertiesOptions"] = None, + resource: Optional["_models.SqlTriggerGetPropertiesResource"] = None, **kwargs: Any ) -> None: """ @@ -16105,25 +12569,20 @@ def __init__( with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :keyword resource: - :paramtype resource: ~azure.mgmt.cosmosdb.models.TableGetPropertiesResource - :keyword options: - :paramtype options: ~azure.mgmt.cosmosdb.models.TableGetPropertiesOptions + :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlTriggerGetPropertiesResource """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource - self.options = options -class TableListResult(_serialization.Model): - """The List operation response, that contains the Table and their properties. +class SqlTriggerListResult(_serialization.Model): + """The List operation response, that contains the triggers and their properties. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of Table and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.TableGetResults] + :ivar value: List of triggers and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.SqlTriggerGetResults] """ _validation = { @@ -16131,7 +12590,7 @@ class TableListResult(_serialization.Model): } _attribute_map = { - "value": {"key": "value", "type": "[TableGetResults]"}, + "value": {"key": "value", "type": "[SqlTriggerGetResults]"}, } def __init__(self, **kwargs: Any) -> None: @@ -16140,295 +12599,336 @@ def __init__(self, **kwargs: Any) -> None: self.value = None -class TableRoleAssignmentListResult(_serialization.Model): - """The relevant Role Assignments. +class SqlUserDefinedFunctionCreateUpdateParameters(ARMResourceProperties): # pylint: disable=name-too-long + """Parameters to create and update Cosmos DB userDefinedFunction. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of Role Assignments and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.TableRoleAssignmentResource] - :ivar next_link: The link used to get the next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[TableRoleAssignmentResource]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class TableRoleAssignmentResource(ProxyResource): - """Parameters to create and update an Azure Cosmos DB Table Role Assignment. - - 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 + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str - :ivar name: The name of the resource. + :ivar name: The name of the ARM resource. :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". + :ivar type: The type of Azure resource. :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cosmosdb.models.SystemData - :ivar role_definition_id: The unique identifier for the associated Role Definition. - :vartype role_definition_id: str - :ivar scope: The data plane resource path for which access is being granted through this Table - Role Assignment. - :vartype scope: str - :ivar principal_id: The unique identifier for the associated AAD principal in the AAD graph to - which access is being granted through this Table Role Assignment. Tenant ID for the principal - is inferred using the tenant associated with the subscription. - :vartype principal_id: str - :ivar provisioning_state: Provisioning state of the resource. - :vartype provisioning_state: str + :ivar location: The location of the resource group to which the resource belongs. + :vartype location: str + :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :vartype tags: dict[str, str] + :ivar resource: The standard JSON format of a userDefinedFunction. Required. + :vartype resource: ~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionResource + :ivar options: A key-value pair of options to be applied for the request. This corresponds to + the headers sent with the request. + :vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, + "resource": {"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"}, - "role_definition_id": {"key": "properties.roleDefinitionId", "type": "str"}, - "scope": {"key": "properties.scope", "type": "str"}, - "principal_id": {"key": "properties.principalId", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "resource": {"key": "properties.resource", "type": "SqlUserDefinedFunctionResource"}, + "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, } def __init__( self, *, - role_definition_id: Optional[str] = None, - scope: Optional[str] = None, - principal_id: Optional[str] = None, + resource: "_models.SqlUserDefinedFunctionResource", + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + options: Optional["_models.CreateUpdateOptions"] = None, **kwargs: Any ) -> None: """ - :keyword role_definition_id: The unique identifier for the associated Role Definition. - :paramtype role_definition_id: str - :keyword scope: The data plane resource path for which access is being granted through this - Table Role Assignment. - :paramtype scope: str - :keyword principal_id: The unique identifier for the associated AAD principal in the AAD graph - to which access is being granted through this Table Role Assignment. Tenant ID for the - principal is inferred using the tenant associated with the subscription. - :paramtype principal_id: str + :keyword location: The location of the resource group to which the resource belongs. + :paramtype location: str + :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :paramtype tags: dict[str, str] + :keyword resource: The standard JSON format of a userDefinedFunction. Required. + :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionResource + :keyword options: A key-value pair of options to be applied for the request. This corresponds + to the headers sent with the request. + :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions + """ + super().__init__(location=location, tags=tags, **kwargs) + self.resource = resource + self.options = options + + +class SqlUserDefinedFunctionResource(_serialization.Model): + """Cosmos DB SQL userDefinedFunction resource object. + + All required parameters must be populated in order to send to server. + + :ivar id: Name of the Cosmos DB SQL userDefinedFunction. Required. + :vartype id: str + :ivar body: Body of the User Defined Function. + :vartype body: str + """ + + _validation = { + "id": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "body": {"key": "body", "type": "str"}, + } + + def __init__( + self, *, id: str, body: Optional[str] = None, **kwargs: Any # pylint: disable=redefined-builtin + ) -> None: + """ + :keyword id: Name of the Cosmos DB SQL userDefinedFunction. Required. + :paramtype id: str + :keyword body: Body of the User Defined Function. + :paramtype body: str """ super().__init__(**kwargs) - self.role_definition_id = role_definition_id - self.scope = scope - self.principal_id = principal_id - self.provisioning_state = None + self.id = id + self.body = body -class TableRoleDefinitionListResult(_serialization.Model): - """The relevant Role Definitions. +class SqlUserDefinedFunctionGetPropertiesResource( + SqlUserDefinedFunctionResource, ExtendedResourceProperties +): # pylint: disable=name-too-long + """SqlUserDefinedFunctionGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of Role Definitions and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.TableRoleDefinitionResource] - :ivar next_link: The link used to get the next page of results. - :vartype next_link: str + All required parameters must be populated in order to send to server. + + :ivar rid: A system generated property. A unique identifier. + :vartype rid: str + :ivar ts: A system generated property that denotes the last updated timestamp of the resource. + :vartype ts: float + :ivar etag: A system generated property representing the resource etag required for optimistic + concurrency control. + :vartype etag: str + :ivar id: Name of the Cosmos DB SQL userDefinedFunction. Required. + :vartype id: str + :ivar body: Body of the User Defined Function. + :vartype body: str """ _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, + "rid": {"readonly": True}, + "ts": {"readonly": True}, + "etag": {"readonly": True}, + "id": {"required": True}, } _attribute_map = { - "value": {"key": "value", "type": "[TableRoleDefinitionResource]"}, - "next_link": {"key": "nextLink", "type": "str"}, + "rid": {"key": "_rid", "type": "str"}, + "ts": {"key": "_ts", "type": "float"}, + "etag": {"key": "_etag", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "body": {"key": "body", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None + def __init__( + self, *, id: str, body: Optional[str] = None, **kwargs: Any # pylint: disable=redefined-builtin + ) -> None: + """ + :keyword id: Name of the Cosmos DB SQL userDefinedFunction. Required. + :paramtype id: str + :keyword body: Body of the User Defined Function. + :paramtype body: str + """ + super().__init__(id=id, body=body, **kwargs) + self.rid = None + self.ts = None + self.etag = None + self.id = id + self.body = body -class TableRoleDefinitionResource(ProxyResource): - """Parameters to create and update an Azure Cosmos DB Table Role Definition. +class SqlUserDefinedFunctionGetResults(ARMResourceProperties): + """An Azure Cosmos DB userDefinedFunction. 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 + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str - :ivar name: The name of the resource. + :ivar name: The name of the ARM resource. :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". + :ivar type: The type of Azure resource. :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cosmosdb.models.SystemData - :ivar id_properties_id: The path id for the Role Definition. - :vartype id_properties_id: str - :ivar role_name: A user-friendly name for the Role Definition. Must be unique for the database - account. - :vartype role_name: str - :ivar type_properties_type: Indicates whether the Role Definition was built-in or user created. - Known values are: "BuiltInRole" and "CustomRole". - :vartype type_properties_type: str or ~azure.mgmt.cosmosdb.models.RoleDefinitionType - :ivar assignable_scopes: A set of fully qualified Scopes at or below which Table Role - Assignments may be created using this Role Definition. This will allow application of this Role - Definition on the entire database account or any underlying Database / Collection. Must have at - least one element. Scopes higher than Database account are not enforceable as assignable - Scopes. Note that resources referenced in assignable Scopes need not exist. - :vartype assignable_scopes: list[str] - :ivar permissions: The set of operations allowed through this Role Definition. - :vartype permissions: list[~azure.mgmt.cosmosdb.models.PermissionAutoGenerated] + :ivar location: The location of the resource group to which the resource belongs. + :vartype location: str + :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :vartype tags: dict[str, str] + :ivar resource: + :vartype resource: ~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionGetPropertiesResource """ _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"}, - "id_properties_id": {"key": "properties.id", "type": "str"}, - "role_name": {"key": "properties.roleName", "type": "str"}, - "type_properties_type": {"key": "properties.type", "type": "str"}, - "assignable_scopes": {"key": "properties.assignableScopes", "type": "[str]"}, - "permissions": {"key": "properties.permissions", "type": "[PermissionAutoGenerated]"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "resource": {"key": "properties.resource", "type": "SqlUserDefinedFunctionGetPropertiesResource"}, } def __init__( self, *, - id_properties_id: Optional[str] = None, - role_name: Optional[str] = None, - type_properties_type: Optional[Union[str, "_models.RoleDefinitionType"]] = None, - assignable_scopes: Optional[List[str]] = None, - permissions: Optional[List["_models.PermissionAutoGenerated"]] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + resource: Optional["_models.SqlUserDefinedFunctionGetPropertiesResource"] = None, **kwargs: Any ) -> None: """ - :keyword id_properties_id: The path id for the Role Definition. - :paramtype id_properties_id: str - :keyword role_name: A user-friendly name for the Role Definition. Must be unique for the - database account. - :paramtype role_name: str - :keyword type_properties_type: Indicates whether the Role Definition was built-in or user - created. Known values are: "BuiltInRole" and "CustomRole". - :paramtype type_properties_type: str or ~azure.mgmt.cosmosdb.models.RoleDefinitionType - :keyword assignable_scopes: A set of fully qualified Scopes at or below which Table Role - Assignments may be created using this Role Definition. This will allow application of this Role - Definition on the entire database account or any underlying Database / Collection. Must have at - least one element. Scopes higher than Database account are not enforceable as assignable - Scopes. Note that resources referenced in assignable Scopes need not exist. - :paramtype assignable_scopes: list[str] - :keyword permissions: The set of operations allowed through this Role Definition. - :paramtype permissions: list[~azure.mgmt.cosmosdb.models.PermissionAutoGenerated] + :keyword location: The location of the resource group to which the resource belongs. + :paramtype location: str + :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :paramtype tags: dict[str, str] + :keyword resource: + :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionGetPropertiesResource """ - super().__init__(**kwargs) - self.id_properties_id = id_properties_id - self.role_name = role_name - self.type_properties_type = type_properties_type - self.assignable_scopes = assignable_scopes - self.permissions = permissions + super().__init__(location=location, tags=tags, **kwargs) + self.resource = resource -class ThroughputBucketResource(_serialization.Model): - """Cosmos DB throughput bucket object. +class SqlUserDefinedFunctionListResult(_serialization.Model): + """The List operation response, that contains the userDefinedFunctions and their properties. - All required parameters must be populated in order to send to server. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Represents the throughput bucket id. Required. - :vartype id: int - :ivar max_throughput_percentage: Represents maximum percentage throughput that can be used by - the bucket. Required. - :vartype max_throughput_percentage: int + :ivar value: List of userDefinedFunctions and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionGetResults] """ _validation = { - "id": {"required": True}, - "max_throughput_percentage": {"required": True}, + "value": {"readonly": True}, } _attribute_map = { - "id": {"key": "id", "type": "int"}, - "max_throughput_percentage": {"key": "maxThroughputPercentage", "type": "int"}, + "value": {"key": "value", "type": "[SqlUserDefinedFunctionGetResults]"}, } - def __init__( - self, *, id: int, max_throughput_percentage: int, **kwargs: Any # pylint: disable=redefined-builtin - ) -> None: - """ - :keyword id: Represents the throughput bucket id. Required. - :paramtype id: int - :keyword max_throughput_percentage: Represents maximum percentage throughput that can be used - by the bucket. Required. - :paramtype max_throughput_percentage: int - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.id = id - self.max_throughput_percentage = max_throughput_percentage + self.value = None -class ThroughputPolicyResource(_serialization.Model): - """Cosmos DB resource throughput policy. +class SystemData(_serialization.Model): + """Metadata pertaining to creation and last modification of the resource. - :ivar is_enabled: Determines whether the ThroughputPolicy is active or not. - :vartype is_enabled: bool - :ivar increment_percent: Represents the percentage by which throughput can increase every time - throughput policy kicks in. - :vartype increment_percent: int + :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.cosmosdb.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.cosmosdb.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime """ _attribute_map = { - "is_enabled": {"key": "isEnabled", "type": "bool"}, - "increment_percent": {"key": "incrementPercent", "type": "int"}, + "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, *, is_enabled: Optional[bool] = None, increment_percent: Optional[int] = None, **kwargs: Any + 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 is_enabled: Determines whether the ThroughputPolicy is active or not. - :paramtype is_enabled: bool - :keyword increment_percent: Represents the percentage by which throughput can increase every - time throughput policy kicks in. - :paramtype increment_percent: int + :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.cosmosdb.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.cosmosdb.models.CreatedByType + :keyword last_modified_at: The timestamp of resource last modification (UTC). + :paramtype last_modified_at: ~datetime.datetime """ super().__init__(**kwargs) - self.is_enabled = is_enabled - self.increment_percent = increment_percent + 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 ThroughputPoolAccountCreateParameters(_serialization.Model): - """Parameters for creating a Azure Cosmos DB throughput pool account. +class TableCreateUpdateParameters(ARMResourceProperties): + """Parameters to create and update Cosmos DB Table. + + Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to server. + + :ivar id: The unique resource identifier of the ARM resource. + :vartype id: str + :ivar name: The name of the ARM resource. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :ivar location: The location of the resource group to which the resource belongs. + :vartype location: str :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value @@ -16436,28 +12936,42 @@ class ThroughputPoolAccountCreateParameters(_serialization.Model): with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :vartype tags: dict[str, str] - :ivar account_resource_identifier: The resource identifier of global database account in the - throughputPool. - :vartype account_resource_identifier: str - :ivar account_location: The location of global database account in the throughputPool. - :vartype account_location: str + :ivar resource: The standard JSON format of a Table. Required. + :vartype resource: ~azure.mgmt.cosmosdb.models.TableResource + :ivar options: A key-value pair of options to be applied for the request. This corresponds to + the headers sent with the request. + :vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "resource": {"required": True}, + } + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, - "account_resource_identifier": {"key": "properties.accountResourceIdentifier", "type": "str"}, - "account_location": {"key": "properties.accountLocation", "type": "str"}, + "resource": {"key": "properties.resource", "type": "TableResource"}, + "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, } def __init__( self, *, + resource: "_models.TableResource", + location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - account_resource_identifier: Optional[str] = None, - account_location: Optional[str] = None, + options: Optional["_models.CreateUpdateOptions"] = None, **kwargs: Any ) -> None: """ + :keyword location: The location of the resource group to which the resource belongs. + :paramtype location: str :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value @@ -16465,313 +12979,262 @@ def __init__( with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :paramtype tags: dict[str, str] - :keyword account_resource_identifier: The resource identifier of global database account in the - throughputPool. - :paramtype account_resource_identifier: str - :keyword account_location: The location of global database account in the throughputPool. - :paramtype account_location: str + :keyword resource: The standard JSON format of a Table. Required. + :paramtype resource: ~azure.mgmt.cosmosdb.models.TableResource + :keyword options: A key-value pair of options to be applied for the request. This corresponds + to the headers sent with the request. + :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ - super().__init__(**kwargs) - self.tags = tags - self.account_resource_identifier = account_resource_identifier - self.account_location = account_location + super().__init__(location=location, tags=tags, **kwargs) + self.resource = resource + self.options = options + + +class TableGetPropertiesOptions(OptionsResource): + """TableGetPropertiesOptions. + + :ivar throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the + ThroughputSetting resource when retrieving offer details. + :vartype throughput: int + :ivar autoscale_settings: Specifies the Autoscale settings. + :vartype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings + """ -class ThroughputPoolAccountResource(ProxyResource): - """An Azure Cosmos DB Throughputpool Account. +class TableResource(_serialization.Model): + """Cosmos DB table resource object. - 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 + :ivar id: Name of the Cosmos DB table. Required. :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.cosmosdb.models.SystemData - :ivar provisioning_state: A provisioning state of the ThroughputPool Account. Known values are: - "Uninitialized", "Initializing", "InternallyReady", "Online", "Deleting", "Succeeded", - "Failed", "Canceled", and "Updating". - :vartype provisioning_state: str or ~azure.mgmt.cosmosdb.models.Status - :ivar account_resource_identifier: The resource identifier of global database account in the - throughputPool. - :vartype account_resource_identifier: str - :ivar account_location: The location of global database account in the throughputPool. - :vartype account_location: str - :ivar account_instance_id: The instance id of global database account in the throughputPool. - :vartype account_instance_id: str + :ivar restore_parameters: Parameters to indicate the information about the restore. + :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" + and "Restore". + :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode """ _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "account_instance_id": {"readonly": True}, + "id": {"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"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "account_resource_identifier": {"key": "properties.accountResourceIdentifier", "type": "str"}, - "account_location": {"key": "properties.accountLocation", "type": "str"}, - "account_instance_id": {"key": "properties.accountInstanceId", "type": "str"}, + "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, + "create_mode": {"key": "createMode", "type": "str"}, } def __init__( self, *, - provisioning_state: Optional[Union[str, "_models.Status"]] = None, - account_resource_identifier: Optional[str] = None, - account_location: Optional[str] = None, + id: str, # pylint: disable=redefined-builtin + restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, + create_mode: Union[str, "_models.CreateMode"] = "Default", **kwargs: Any ) -> None: """ - :keyword provisioning_state: A provisioning state of the ThroughputPool Account. Known values - are: "Uninitialized", "Initializing", "InternallyReady", "Online", "Deleting", "Succeeded", - "Failed", "Canceled", and "Updating". - :paramtype provisioning_state: str or ~azure.mgmt.cosmosdb.models.Status - :keyword account_resource_identifier: The resource identifier of global database account in the - throughputPool. - :paramtype account_resource_identifier: str - :keyword account_location: The location of global database account in the throughputPool. - :paramtype account_location: str + :keyword id: Name of the Cosmos DB table. Required. + :paramtype id: str + :keyword restore_parameters: Parameters to indicate the information about the restore. + :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: + "Default" and "Restore". + :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode """ super().__init__(**kwargs) - self.provisioning_state = provisioning_state - self.account_resource_identifier = account_resource_identifier - self.account_location = account_location - self.account_instance_id = None - - -class ThroughputPoolAccountsListResult(_serialization.Model): - """The List operation response, that contains the global database accounts and their properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of global database accounts in a throughput pool and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource] - :ivar next_link: The link used to get the next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ThroughputPoolAccountResource]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None + self.id = id + self.restore_parameters = restore_parameters + self.create_mode = create_mode -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which - has 'tags' and a 'location'. +class TableGetPropertiesResource(TableResource, ExtendedResourceProperties): + """TableGetPropertiesResource. 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 + :ivar rid: A system generated property. A unique identifier. + :vartype rid: str + :ivar ts: A system generated property that denotes the last updated timestamp of the resource. + :vartype ts: float + :ivar etag: A system generated property representing the resource etag required for optimistic + concurrency control. + :vartype etag: str + :ivar id: Name of the Cosmos DB table. Required. :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.cosmosdb.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 restore_parameters: Parameters to indicate the information about the restore. + :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" + and "Restore". + :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode """ _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, + "rid": {"readonly": True}, + "ts": {"readonly": True}, + "etag": {"readonly": True}, + "id": {"required": True}, } _attribute_map = { + "rid": {"key": "_rid", "type": "str"}, + "ts": {"key": "_ts", "type": "float"}, + "etag": {"key": "_etag", "type": "str"}, "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"}, + "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, + "create_mode": {"key": "createMode", "type": "str"}, } - def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, + create_mode: Union[str, "_models.CreateMode"] = "Default", + **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 id: Name of the Cosmos DB table. Required. + :paramtype id: str + :keyword restore_parameters: Parameters to indicate the information about the restore. + :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: + "Default" and "Restore". + :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode """ - super().__init__(**kwargs) - self.tags = tags - self.location = location + super().__init__(id=id, restore_parameters=restore_parameters, create_mode=create_mode, **kwargs) + self.rid = None + self.ts = None + self.etag = None + self.id = id + self.restore_parameters = restore_parameters + self.create_mode = create_mode -class ThroughputPoolResource(TrackedResource): - """An Azure Cosmos DB Throughputpool. +class TableGetResults(ARMResourceProperties): + """An Azure Cosmos DB Table. 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 + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str - :ivar name: The name of the resource. + :ivar name: The name of the ARM resource. :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". + :ivar type: The type of Azure resource. :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cosmosdb.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. + :ivar location: The location of the resource group to which the resource belongs. :vartype location: str - :ivar provisioning_state: A provisioning state of the ThroughputPool. Known values are: - "Uninitialized", "Initializing", "InternallyReady", "Online", "Deleting", "Succeeded", - "Failed", "Canceled", and "Updating". - :vartype provisioning_state: str or ~azure.mgmt.cosmosdb.models.Status - :ivar max_throughput: Value for throughput to be shared among CosmosDB resources in the pool. - :vartype max_throughput: int + :ivar tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :vartype tags: dict[str, str] + :ivar resource: + :vartype resource: ~azure.mgmt.cosmosdb.models.TableGetPropertiesResource + :ivar options: + :vartype options: ~azure.mgmt.cosmosdb.models.TableGetPropertiesOptions """ _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"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "max_throughput": {"key": "properties.maxThroughput", "type": "int"}, + "tags": {"key": "tags", "type": "{str}"}, + "resource": {"key": "properties.resource", "type": "TableGetPropertiesResource"}, + "options": {"key": "properties.options", "type": "TableGetPropertiesOptions"}, } def __init__( self, *, - location: str, + location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - provisioning_state: Optional[Union[str, "_models.Status"]] = None, - max_throughput: Optional[int] = None, + resource: Optional["_models.TableGetPropertiesResource"] = None, + options: Optional["_models.TableGetPropertiesOptions"] = None, **kwargs: Any ) -> None: """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. + :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str - :keyword provisioning_state: A provisioning state of the ThroughputPool. Known values are: - "Uninitialized", "Initializing", "InternallyReady", "Online", "Deleting", "Succeeded", - "Failed", "Canceled", and "Updating". - :paramtype provisioning_state: str or ~azure.mgmt.cosmosdb.models.Status - :keyword max_throughput: Value for throughput to be shared among CosmosDB resources in the - pool. - :paramtype max_throughput: int + :keyword tags: Tags are a list of key-value pairs that describe the resource. These tags can be + used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + be provided for a resource. Each tag must have a key no greater than 128 characters and value + no greater than 256 characters. For example, the default experience for a template type is set + with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", + "Graph", "DocumentDB", and "MongoDB". + :paramtype tags: dict[str, str] + :keyword resource: + :paramtype resource: ~azure.mgmt.cosmosdb.models.TableGetPropertiesResource + :keyword options: + :paramtype options: ~azure.mgmt.cosmosdb.models.TableGetPropertiesOptions """ - super().__init__(tags=tags, location=location, **kwargs) - self.provisioning_state = provisioning_state - self.max_throughput = max_throughput + super().__init__(location=location, tags=tags, **kwargs) + self.resource = resource + self.options = options -class ThroughputPoolsListResult(_serialization.Model): - """The List operation response, that contains the throughput pools and their properties. +class TableListResult(_serialization.Model): + """The List operation response, that contains the Table and their properties. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of throughput pools and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :ivar next_link: The link used to get the next page of results. - :vartype next_link: str + :ivar value: List of Table and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.TableGetResults] """ _validation = { "value": {"readonly": True}, - "next_link": {"readonly": True}, } _attribute_map = { - "value": {"key": "value", "type": "[ThroughputPoolResource]"}, - "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[TableGetResults]"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None - self.next_link = None -class ThroughputPoolUpdate(_serialization.Model): - """Represents a throughput pool resource for updates. +class ThroughputPolicyResource(_serialization.Model): + """Cosmos DB resource throughput policy. - :ivar provisioning_state: A provisioning state of the ThroughputPool. Known values are: - "Uninitialized", "Initializing", "InternallyReady", "Online", "Deleting", "Succeeded", - "Failed", "Canceled", and "Updating". - :vartype provisioning_state: str or ~azure.mgmt.cosmosdb.models.Status - :ivar max_throughput: Value for throughput to be shared among CosmosDB resources in the pool. - :vartype max_throughput: int + :ivar is_enabled: Determines whether the ThroughputPolicy is active or not. + :vartype is_enabled: bool + :ivar increment_percent: Represents the percentage by which throughput can increase every time + throughput policy kicks in. + :vartype increment_percent: int """ _attribute_map = { - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "max_throughput": {"key": "properties.maxThroughput", "type": "int"}, + "is_enabled": {"key": "isEnabled", "type": "bool"}, + "increment_percent": {"key": "incrementPercent", "type": "int"}, } def __init__( - self, - *, - provisioning_state: Optional[Union[str, "_models.Status"]] = None, - max_throughput: Optional[int] = None, - **kwargs: Any + self, *, is_enabled: Optional[bool] = None, increment_percent: Optional[int] = None, **kwargs: Any ) -> None: """ - :keyword provisioning_state: A provisioning state of the ThroughputPool. Known values are: - "Uninitialized", "Initializing", "InternallyReady", "Online", "Deleting", "Succeeded", - "Failed", "Canceled", and "Updating". - :paramtype provisioning_state: str or ~azure.mgmt.cosmosdb.models.Status - :keyword max_throughput: Value for throughput to be shared among CosmosDB resources in the - pool. - :paramtype max_throughput: int + :keyword is_enabled: Determines whether the ThroughputPolicy is active or not. + :paramtype is_enabled: bool + :keyword increment_percent: Represents the percentage by which throughput can increase every + time throughput policy kicks in. + :paramtype increment_percent: int """ super().__init__(**kwargs) - self.provisioning_state = provisioning_state - self.max_throughput = max_throughput + self.is_enabled = is_enabled + self.increment_percent = increment_percent class ThroughputSettingsResource(_serialization.Model): @@ -16796,9 +13259,6 @@ class ThroughputSettingsResource(_serialization.Model): :ivar soft_allowed_maximum_throughput: The maximum throughput value or the maximum maxThroughput value (for autoscale) that can be specified. :vartype soft_allowed_maximum_throughput: str - :ivar throughput_buckets: Array of Throughput Bucket limits to be applied to the Cosmos DB - container. - :vartype throughput_buckets: list[~azure.mgmt.cosmosdb.models.ThroughputBucketResource] """ _validation = { @@ -16815,7 +13275,6 @@ class ThroughputSettingsResource(_serialization.Model): "offer_replace_pending": {"key": "offerReplacePending", "type": "str"}, "instant_maximum_throughput": {"key": "instantMaximumThroughput", "type": "str"}, "soft_allowed_maximum_throughput": {"key": "softAllowedMaximumThroughput", "type": "str"}, - "throughput_buckets": {"key": "throughputBuckets", "type": "[ThroughputBucketResource]"}, } def __init__( @@ -16823,7 +13282,6 @@ def __init__( *, throughput: Optional[int] = None, autoscale_settings: Optional["_models.AutoscaleSettingsResource"] = None, - throughput_buckets: Optional[List["_models.ThroughputBucketResource"]] = None, **kwargs: Any ) -> None: """ @@ -16833,9 +13291,6 @@ def __init__( :keyword autoscale_settings: Cosmos DB resource for autoscale settings. Either throughput is required or autoscaleSettings is required, but not both. :paramtype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettingsResource - :keyword throughput_buckets: Array of Throughput Bucket limits to be applied to the Cosmos DB - container. - :paramtype throughput_buckets: list[~azure.mgmt.cosmosdb.models.ThroughputBucketResource] """ super().__init__(**kwargs) self.throughput = throughput @@ -16844,7 +13299,6 @@ def __init__( self.offer_replace_pending = None self.instant_maximum_throughput = None self.soft_allowed_maximum_throughput = None - self.throughput_buckets = throughput_buckets class ThroughputSettingsGetPropertiesResource(ThroughputSettingsResource, ExtendedResourceProperties): @@ -16875,9 +13329,6 @@ class ThroughputSettingsGetPropertiesResource(ThroughputSettingsResource, Extend :ivar soft_allowed_maximum_throughput: The maximum throughput value or the maximum maxThroughput value (for autoscale) that can be specified. :vartype soft_allowed_maximum_throughput: str - :ivar throughput_buckets: Array of Throughput Bucket limits to be applied to the Cosmos DB - container. - :vartype throughput_buckets: list[~azure.mgmt.cosmosdb.models.ThroughputBucketResource] """ _validation = { @@ -16900,7 +13351,6 @@ class ThroughputSettingsGetPropertiesResource(ThroughputSettingsResource, Extend "offer_replace_pending": {"key": "offerReplacePending", "type": "str"}, "instant_maximum_throughput": {"key": "instantMaximumThroughput", "type": "str"}, "soft_allowed_maximum_throughput": {"key": "softAllowedMaximumThroughput", "type": "str"}, - "throughput_buckets": {"key": "throughputBuckets", "type": "[ThroughputBucketResource]"}, } def __init__( @@ -16908,7 +13358,6 @@ def __init__( *, throughput: Optional[int] = None, autoscale_settings: Optional["_models.AutoscaleSettingsResource"] = None, - throughput_buckets: Optional[List["_models.ThroughputBucketResource"]] = None, **kwargs: Any ) -> None: """ @@ -16918,16 +13367,8 @@ def __init__( :keyword autoscale_settings: Cosmos DB resource for autoscale settings. Either throughput is required or autoscaleSettings is required, but not both. :paramtype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettingsResource - :keyword throughput_buckets: Array of Throughput Bucket limits to be applied to the Cosmos DB - container. - :paramtype throughput_buckets: list[~azure.mgmt.cosmosdb.models.ThroughputBucketResource] """ - super().__init__( - throughput=throughput, - autoscale_settings=autoscale_settings, - throughput_buckets=throughput_buckets, - **kwargs - ) + super().__init__(throughput=throughput, autoscale_settings=autoscale_settings, **kwargs) self.rid = None self.ts = None self.etag = None @@ -16937,7 +13378,6 @@ def __init__( self.offer_replace_pending = None self.instant_maximum_throughput = None self.soft_allowed_maximum_throughput = None - self.throughput_buckets = throughput_buckets class ThroughputSettingsGetResults(ARMResourceProperties): @@ -16960,8 +13400,6 @@ class ThroughputSettingsGetResults(ARMResourceProperties): with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :ivar resource: :vartype resource: ~azure.mgmt.cosmosdb.models.ThroughputSettingsGetPropertiesResource """ @@ -16978,7 +13416,6 @@ class ThroughputSettingsGetResults(ARMResourceProperties): "type": {"key": "type", "type": "str"}, "location": {"key": "location", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, "resource": {"key": "properties.resource", "type": "ThroughputSettingsGetPropertiesResource"}, } @@ -16987,7 +13424,6 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.ThroughputSettingsGetPropertiesResource"] = None, **kwargs: Any ) -> None: @@ -17001,12 +13437,10 @@ def __init__( with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :keyword resource: :paramtype resource: ~azure.mgmt.cosmosdb.models.ThroughputSettingsGetPropertiesResource """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource @@ -17032,8 +13466,6 @@ class ThroughputSettingsUpdateParameters(ARMResourceProperties): with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :vartype tags: dict[str, str] - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :ivar resource: The standard JSON format of a resource throughput. Required. :vartype resource: ~azure.mgmt.cosmosdb.models.ThroughputSettingsResource """ @@ -17051,7 +13483,6 @@ class ThroughputSettingsUpdateParameters(ARMResourceProperties): "type": {"key": "type", "type": "str"}, "location": {"key": "location", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, "resource": {"key": "properties.resource", "type": "ThroughputSettingsResource"}, } @@ -17061,7 +13492,6 @@ def __init__( resource: "_models.ThroughputSettingsResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, **kwargs: Any ) -> None: """ @@ -17074,12 +13504,10 @@ def __init__( with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :paramtype tags: dict[str, str] - :keyword identity: Identity for the resource. - :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :keyword resource: The standard JSON format of a resource throughput. Required. :paramtype resource: ~azure.mgmt.cosmosdb.models.ThroughputSettingsResource """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/__init__.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/__init__.py index 2654ee4c1eb6..d47da53e4f4d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/__init__.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/__init__.py @@ -12,7 +12,6 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._chaos_fault_operations import ChaosFaultOperations # type: ignore from ._database_accounts_operations import DatabaseAccountsOperations # type: ignore from ._operations import Operations # type: ignore from ._database_operations import DatabaseOperations # type: ignore @@ -26,17 +25,14 @@ from ._collection_partition_operations import CollectionPartitionOperations # type: ignore from ._partition_key_range_id_operations import PartitionKeyRangeIdOperations # type: ignore from ._partition_key_range_id_region_operations import PartitionKeyRangeIdRegionOperations # type: ignore -from ._graph_resources_operations import GraphResourcesOperations # type: ignore from ._sql_resources_operations import SqlResourcesOperations # type: ignore from ._mongo_db_resources_operations import MongoDBResourcesOperations # type: ignore from ._table_resources_operations import TableResourcesOperations # type: ignore from ._cassandra_resources_operations import CassandraResourcesOperations # type: ignore from ._gremlin_resources_operations import GremlinResourcesOperations # type: ignore from ._locations_operations import LocationsOperations # type: ignore -from ._data_transfer_jobs_operations import DataTransferJobsOperations # type: ignore from ._cassandra_clusters_operations import CassandraClustersOperations # type: ignore from ._cassandra_data_centers_operations import CassandraDataCentersOperations # type: ignore -from ._network_security_perimeter_configurations_operations import NetworkSecurityPerimeterConfigurationsOperations # type: ignore from ._notebook_workspaces_operations import NotebookWorkspacesOperations # type: ignore from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations # type: ignore from ._private_link_resources_operations import PrivateLinkResourcesOperations # type: ignore @@ -53,17 +49,12 @@ from ._restorable_tables_operations import RestorableTablesOperations # type: ignore from ._restorable_table_resources_operations import RestorableTableResourcesOperations # type: ignore from ._service_operations import ServiceOperations # type: ignore -from ._throughput_pools_operations import ThroughputPoolsOperations # type: ignore -from ._throughput_pool_operations import ThroughputPoolOperations # type: ignore -from ._throughput_pool_accounts_operations import ThroughputPoolAccountsOperations # type: ignore -from ._throughput_pool_account_operations import ThroughputPoolAccountOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ - "ChaosFaultOperations", "DatabaseAccountsOperations", "Operations", "DatabaseOperations", @@ -77,17 +68,14 @@ "CollectionPartitionOperations", "PartitionKeyRangeIdOperations", "PartitionKeyRangeIdRegionOperations", - "GraphResourcesOperations", "SqlResourcesOperations", "MongoDBResourcesOperations", "TableResourcesOperations", "CassandraResourcesOperations", "GremlinResourcesOperations", "LocationsOperations", - "DataTransferJobsOperations", "CassandraClustersOperations", "CassandraDataCentersOperations", - "NetworkSecurityPerimeterConfigurationsOperations", "NotebookWorkspacesOperations", "PrivateEndpointConnectionsOperations", "PrivateLinkResourcesOperations", @@ -104,10 +92,6 @@ "RestorableTablesOperations", "RestorableTableResourcesOperations", "ServiceOperations", - "ThroughputPoolsOperations", - "ThroughputPoolOperations", - "ThroughputPoolAccountsOperations", - "ThroughputPoolAccountOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_clusters_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_clusters_operations.py index f81ee2645b69..834f1a469c80 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_clusters_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_clusters_operations.py @@ -48,7 +48,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -56,7 +56,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/cassandraClusters" ) path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -74,7 +74,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +83,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -104,7 +104,7 @@ def build_get_request(resource_group_name: str, cluster_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,7 +113,7 @@ def build_get_request(resource_group_name: str, cluster_name: str, subscription_ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -139,7 +139,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -148,7 +148,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -174,7 +174,7 @@ def build_create_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -184,7 +184,7 @@ def build_create_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -212,7 +212,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -222,7 +222,7 @@ def build_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -250,7 +250,7 @@ def build_invoke_command_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -260,7 +260,7 @@ def build_invoke_command_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/invokeCommand", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -282,200 +282,13 @@ def build_invoke_command_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_invoke_command_async_request( - resource_group_name: str, 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", "2024-12-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/invokeCommandAsync", - ) # 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 - ), - "clusterName": _SERIALIZER.url( - "cluster_name", cluster_name, "str", max_length=100, min_length=1, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$" - ), - } - - _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_command_request( - resource_group_name: str, 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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/commands", - ) # 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 - ), - "clusterName": _SERIALIZER.url( - "cluster_name", cluster_name, "str", max_length=100, min_length=1, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$" - ), - } - - _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_command_async_request( - resource_group_name: str, cluster_name: str, command_id: 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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/commands/{commandId}", - ) # 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 - ), - "clusterName": _SERIALIZER.url( - "cluster_name", cluster_name, "str", max_length=100, min_length=1, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$" - ), - "commandId": _SERIALIZER.url( - "command_id", command_id, "str", max_length=100, min_length=1, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$" - ), - } - - _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_backups_request( - resource_group_name: str, 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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups", - ) # 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 - ), - "clusterName": _SERIALIZER.url( - "cluster_name", cluster_name, "str", max_length=100, min_length=1, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$" - ), - } - - _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_backup_request( - resource_group_name: str, cluster_name: str, backup_id: 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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups/{backupId}", - ) # 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 - ), - "clusterName": _SERIALIZER.url( - "cluster_name", cluster_name, "str", max_length=100, min_length=1, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$" - ), - "backupId": _SERIALIZER.url("backup_id", backup_id, "str", max_length=15, min_length=1, pattern=r"^[0-9]+$"), - } - - _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_deallocate_request( - resource_group_name: str, - cluster_name: str, - subscription_id: str, - *, - x_ms_force_deallocate: Optional[str] = None, - **kwargs: Any + resource_group_name: str, 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", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -484,7 +297,7 @@ def build_deallocate_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -499,8 +312,6 @@ def build_deallocate_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if x_ms_force_deallocate is not None: - _headers["x-ms-force-deallocate"] = _SERIALIZER.header("x_ms_force_deallocate", x_ms_force_deallocate, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) @@ -512,7 +323,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -521,7 +332,7 @@ def build_start_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/start", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -547,7 +358,7 @@ def build_status_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -556,7 +367,7 @@ def build_status_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/status", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -576,7 +387,7 @@ def build_status_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -class CassandraClustersOperations: # pylint: disable=too-many-public-methods +class CassandraClustersOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -1484,496 +1295,7 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _invoke_command_async_initial( - self, - resource_group_name: str, - cluster_name: str, - body: Union[_models.CommandAsyncPostBody, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "CommandAsyncPostBody") - - _request = build_invoke_command_async_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - 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["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_invoke_command_async( - self, - resource_group_name: str, - cluster_name: str, - body: _models.CommandAsyncPostBody, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommandPublicResource]: - """Invoke a command like nodetool for cassandra maintenance asynchronously. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :param body: Specification which command to run where. Required. - :type body: ~azure.mgmt.cosmosdb.models.CommandAsyncPostBody - :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 CommandPublicResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CommandPublicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_invoke_command_async( - self, - resource_group_name: str, - cluster_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommandPublicResource]: - """Invoke a command like nodetool for cassandra maintenance asynchronously. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :param body: Specification which command to run where. 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 CommandPublicResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CommandPublicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_invoke_command_async( - self, - resource_group_name: str, - cluster_name: str, - body: Union[_models.CommandAsyncPostBody, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.CommandPublicResource]: - """Invoke a command like nodetool for cassandra maintenance asynchronously. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :param body: Specification which command to run where. Is either a CommandAsyncPostBody type or - a IO[bytes] type. Required. - :type body: ~azure.mgmt.cosmosdb.models.CommandAsyncPostBody or IO[bytes] - :return: An instance of LROPoller that returns either CommandPublicResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CommandPublicResource] - :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.CommandPublicResource] = 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._invoke_command_async_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommandPublicResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.CommandPublicResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.CommandPublicResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def list_command( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> Iterable["_models.CommandPublicResource"]: - """List all commands currently running on ring info. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :return: An iterator like instance of either CommandPublicResource or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.CommandPublicResource] - :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.ListCommands] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_command_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ListCommands", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_command_async( - self, resource_group_name: str, cluster_name: str, command_id: str, **kwargs: Any - ) -> _models.CommandPublicResource: - """Get details about a specified command that was run asynchronously. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :param command_id: Managed Cassandra cluster command id. Required. - :type command_id: str - :return: CommandPublicResource or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.CommandPublicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CommandPublicResource] = kwargs.pop("cls", None) - - _request = build_get_command_async_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - command_id=command_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CommandPublicResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_backups( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> Iterable["_models.BackupResource"]: - """List the backups of this cluster that are available to restore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :return: An iterator like instance of either BackupResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.BackupResource] - :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.ListBackups] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_backups_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ListBackups", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_backup( - self, resource_group_name: str, cluster_name: str, backup_id: str, **kwargs: Any - ) -> _models.BackupResource: - """Get the properties of an individual backup of this cluster that is available to restore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :param backup_id: Id of a restorable backup of a Cassandra cluster. Required. - :type backup_id: str - :return: BackupResource or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.BackupResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BackupResource] = kwargs.pop("cls", None) - - _request = build_get_backup_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - backup_id=backup_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("BackupResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _deallocate_initial( - self, resource_group_name: str, cluster_name: str, x_ms_force_deallocate: Optional[str] = None, **kwargs: Any - ) -> Iterator[bytes]: + def _deallocate_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1992,7 +1314,6 @@ def _deallocate_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, - x_ms_force_deallocate=x_ms_force_deallocate, api_version=api_version, headers=_headers, params=_params, @@ -2023,9 +1344,7 @@ def _deallocate_initial( return deserialized # type: ignore @distributed_trace - def begin_deallocate( - self, resource_group_name: str, cluster_name: str, x_ms_force_deallocate: Optional[str] = None, **kwargs: Any - ) -> LROPoller[None]: + def begin_deallocate(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[None]: """Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated cluster. Use Start to restart the cluster. @@ -2035,10 +1354,6 @@ def begin_deallocate( :type resource_group_name: str :param cluster_name: Managed Cassandra cluster name. Required. :type cluster_name: str - :param x_ms_force_deallocate: Force to deallocate a cluster of Cluster Type Production. Force - to deallocate a cluster of Cluster Type Production might cause data loss. Default value is - None. - :type x_ms_force_deallocate: 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: @@ -2055,7 +1370,6 @@ def begin_deallocate( raw_result = self._deallocate_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, - x_ms_force_deallocate=x_ms_force_deallocate, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_data_centers_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_data_centers_operations.py index e0cee0656e01..c331df915a07 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_data_centers_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_data_centers_operations.py @@ -47,7 +47,7 @@ def build_list_request(resource_group_name: str, cluster_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -56,7 +56,7 @@ def build_list_request(resource_group_name: str, cluster_name: str, subscription "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -82,7 +82,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -91,7 +91,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -125,7 +125,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -134,7 +134,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -168,7 +168,7 @@ def build_create_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -178,7 +178,7 @@ def build_create_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -214,7 +214,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -224,7 +224,7 @@ def build_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_resources_operations.py index e91e4db53617..3e96491acd50 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_resources_operations.py @@ -50,7 +50,7 @@ def build_list_cassandra_keyspaces_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +59,7 @@ def build_list_cassandra_keyspaces_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -85,7 +85,7 @@ def build_get_cassandra_keyspace_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +94,7 @@ def build_get_cassandra_keyspace_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -121,7 +121,7 @@ def build_create_update_cassandra_keyspace_request( # pylint: disable=name-too- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -131,7 +131,7 @@ def build_create_update_cassandra_keyspace_request( # pylint: disable=name-too- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -159,14 +159,14 @@ def build_delete_cassandra_keyspace_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -190,7 +190,7 @@ def build_get_cassandra_keyspace_throughput_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -199,7 +199,7 @@ def build_get_cassandra_keyspace_throughput_request( # pylint: disable=name-too "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -226,7 +226,7 @@ def build_update_cassandra_keyspace_throughput_request( # pylint: disable=name- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -236,7 +236,7 @@ def build_update_cassandra_keyspace_throughput_request( # pylint: disable=name- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -265,7 +265,7 @@ def build_migrate_cassandra_keyspace_to_autoscale_request( # pylint: disable=na _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -274,7 +274,7 @@ def build_migrate_cassandra_keyspace_to_autoscale_request( # pylint: disable=na "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -301,7 +301,7 @@ def build_migrate_cassandra_keyspace_to_manual_throughput_request( # pylint: di _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -310,7 +310,7 @@ def build_migrate_cassandra_keyspace_to_manual_throughput_request( # pylint: di "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -337,7 +337,7 @@ def build_list_cassandra_tables_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -346,7 +346,7 @@ def build_list_cassandra_tables_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -378,7 +378,7 @@ def build_get_cassandra_table_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -387,7 +387,7 @@ def build_get_cassandra_table_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -420,7 +420,7 @@ def build_create_update_cassandra_table_request( # pylint: disable=name-too-lon _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -430,7 +430,7 @@ def build_create_update_cassandra_table_request( # pylint: disable=name-too-lon "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -464,14 +464,14 @@ def build_delete_cassandra_table_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -501,7 +501,7 @@ def build_get_cassandra_table_throughput_request( # pylint: disable=name-too-lo _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -510,7 +510,7 @@ def build_get_cassandra_table_throughput_request( # pylint: disable=name-too-lo "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -543,7 +543,7 @@ def build_update_cassandra_table_throughput_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -553,7 +553,7 @@ def build_update_cassandra_table_throughput_request( # pylint: disable=name-too "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -588,7 +588,7 @@ def build_migrate_cassandra_table_to_autoscale_request( # pylint: disable=name- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -597,7 +597,7 @@ def build_migrate_cassandra_table_to_autoscale_request( # pylint: disable=name- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -630,7 +630,7 @@ def build_migrate_cassandra_table_to_manual_throughput_request( # pylint: disab _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -639,7 +639,7 @@ def build_migrate_cassandra_table_to_manual_throughput_request( # pylint: disab "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -661,301 +661,6 @@ def build_migrate_cassandra_table_to_manual_throughput_request( # pylint: disab return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_cassandra_views_request( - resource_group_name: str, account_name: str, keyspace_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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_cassandra_view_request( - resource_group_name: str, account_name: str, keyspace_name: str, view_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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), - "viewName": _SERIALIZER.url("view_name", view_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_update_cassandra_view_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, keyspace_name: str, view_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", "2024-12-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), - "viewName": _SERIALIZER.url("view_name", view_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_cassandra_view_request( - resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), - "viewName": _SERIALIZER.url("view_name", view_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_get_cassandra_view_throughput_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, keyspace_name: str, view_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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), - "viewName": _SERIALIZER.url("view_name", view_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_update_cassandra_view_throughput_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, keyspace_name: str, view_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", "2024-12-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), - "viewName": _SERIALIZER.url("view_name", view_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_migrate_cassandra_view_to_autoscale_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, keyspace_name: str, view_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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), - "viewName": _SERIALIZER.url("view_name", view_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_migrate_cassandra_view_to_manual_throughput_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, keyspace_name: str, view_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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), - "viewName": _SERIALIZER.url("view_name", view_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - class CassandraResourcesOperations: # pylint: disable=too-many-public-methods """ .. warning:: @@ -3014,1043 +2719,3 @@ def get_long_running_output(pipeline_response): return LROPoller[_models.ThroughputSettingsGetResults]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - - @distributed_trace - def list_cassandra_views( - self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any - ) -> Iterable["_models.CassandraViewGetResults"]: - """Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :return: An iterator like instance of either CassandraViewGetResults or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.CassandraViewGetResults] - :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.CassandraViewListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_cassandra_views_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CassandraViewListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_cassandra_view( - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any - ) -> _models.CassandraViewGetResults: - """Gets the Cassandra view under an existing Azure Cosmos DB database account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :return: CassandraViewGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.CassandraViewGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CassandraViewGetResults] = kwargs.pop("cls", None) - - _request = build_get_cassandra_view_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CassandraViewGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_update_cassandra_view_initial( - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - view_name: str, - create_update_cassandra_view_parameters: Union[_models.CassandraViewCreateUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(create_update_cassandra_view_parameters, (IOBase, bytes)): - _content = create_update_cassandra_view_parameters - else: - _json = self._serialize.body(create_update_cassandra_view_parameters, "CassandraViewCreateUpdateParameters") - - _request = build_create_update_cassandra_view_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_update_cassandra_view( - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - view_name: str, - create_update_cassandra_view_parameters: _models.CassandraViewCreateUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CassandraViewGetResults]: - """Create or update an Azure Cosmos DB Cassandra View. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :param create_update_cassandra_view_parameters: The parameters to provide for the current - Cassandra View. Required. - :type create_update_cassandra_view_parameters: - ~azure.mgmt.cosmosdb.models.CassandraViewCreateUpdateParameters - :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 CassandraViewGetResults or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraViewGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_update_cassandra_view( - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - view_name: str, - create_update_cassandra_view_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CassandraViewGetResults]: - """Create or update an Azure Cosmos DB Cassandra View. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :param create_update_cassandra_view_parameters: The parameters to provide for the current - Cassandra View. Required. - :type create_update_cassandra_view_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either CassandraViewGetResults or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraViewGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_update_cassandra_view( - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - view_name: str, - create_update_cassandra_view_parameters: Union[_models.CassandraViewCreateUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.CassandraViewGetResults]: - """Create or update an Azure Cosmos DB Cassandra View. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :param create_update_cassandra_view_parameters: The parameters to provide for the current - Cassandra View. Is either a CassandraViewCreateUpdateParameters type or a IO[bytes] type. - Required. - :type create_update_cassandra_view_parameters: - ~azure.mgmt.cosmosdb.models.CassandraViewCreateUpdateParameters or IO[bytes] - :return: An instance of LROPoller that returns either CassandraViewGetResults or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraViewGetResults] - :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.CassandraViewGetResults] = 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_update_cassandra_view_initial( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - create_update_cassandra_view_parameters=create_update_cassandra_view_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CassandraViewGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.CassandraViewGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.CassandraViewGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_cassandra_view_initial( - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_cassandra_view_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete_cassandra_view( - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes an existing Azure Cosmos DB Cassandra view. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._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_cassandra_view_initial( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def get_cassandra_view_throughput( - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any - ) -> _models.ThroughputSettingsGetResults: - """Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database - account with the provided name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :return: ThroughputSettingsGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) - - _request = build_get_cassandra_view_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _update_cassandra_view_throughput_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - view_name: str, - update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(update_throughput_parameters, (IOBase, bytes)): - _content = update_throughput_parameters - else: - _json = self._serialize.body(update_throughput_parameters, "ThroughputSettingsUpdateParameters") - - _request = build_update_cassandra_view_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update_cassandra_view_throughput( - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - view_name: str, - update_throughput_parameters: _models.ThroughputSettingsUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB Cassandra view. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :param update_throughput_parameters: The RUs per second of the parameters to provide for the - current Cassandra view. Required. - :type update_throughput_parameters: - ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters - :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 ThroughputSettingsGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_cassandra_view_throughput( - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - view_name: str, - update_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB Cassandra view. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :param update_throughput_parameters: The RUs per second of the parameters to provide for the - current Cassandra view. Required. - :type update_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_cassandra_view_throughput( - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - view_name: str, - update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB Cassandra view. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :param update_throughput_parameters: The RUs per second of the parameters to provide for the - current Cassandra view. Is either a ThroughputSettingsUpdateParameters type or a IO[bytes] - type. Required. - :type update_throughput_parameters: - ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters or IO[bytes] - :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :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.ThroughputSettingsGetResults] = 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_cassandra_view_throughput_initial( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - update_throughput_parameters=update_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ThroughputSettingsGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _migrate_cassandra_view_to_autoscale_initial( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_migrate_cassandra_view_to_autoscale_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_migrate_cassandra_view_to_autoscale( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any - ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :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.ThroughputSettingsGetResults] = 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._migrate_cassandra_view_to_autoscale_initial( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ThroughputSettingsGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _migrate_cassandra_view_to_manual_throughput_initial( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_migrate_cassandra_view_to_manual_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_migrate_cassandra_view_to_manual_throughput( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any - ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :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.ThroughputSettingsGetResults] = 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._migrate_cassandra_view_to_manual_throughput_initial( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ThroughputSettingsGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_chaos_fault_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_chaos_fault_operations.py deleted file mode 100644 index 990e1f522bc9..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_chaos_fault_operations.py +++ /dev/null @@ -1,523 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request(resource_group_name: str, account_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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - } - - _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_enable_disable_request( - resource_group_name: str, account_name: str, chaos_fault: 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", "2024-12-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults/{chaosFault}", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "chaosFault": _SERIALIZER.url("chaos_fault", chaos_fault, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, account_name: str, chaos_fault: 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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults/{chaosFault}", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "chaosFault": _SERIALIZER.url("chaos_fault", chaos_fault, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class ChaosFaultOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.CosmosDBManagementClient`'s - :attr:`chaos_fault` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> Iterable["_models.ChaosFaultResource"]: - """List Chaos Faults for CosmosDB account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :return: An iterator like instance of either ChaosFaultResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.ChaosFaultResource] - :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.ChaosFaultListResponse] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ChaosFaultListResponse", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _enable_disable_initial( - self, - resource_group_name: str, - account_name: str, - chaos_fault: str, - chaos_fault_request: Union[_models.ChaosFaultResource, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(chaos_fault_request, (IOBase, bytes)): - _content = chaos_fault_request - else: - _json = self._serialize.body(chaos_fault_request, "ChaosFaultResource") - - _request = build_enable_disable_request( - resource_group_name=resource_group_name, - account_name=account_name, - chaos_fault=chaos_fault, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_enable_disable( - self, - resource_group_name: str, - account_name: str, - chaos_fault: str, - chaos_fault_request: _models.ChaosFaultResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ChaosFaultResource]: - """Enable, disable Chaos Fault in a CosmosDB account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param chaos_fault: The name of the ChaosFault. Required. - :type chaos_fault: str - :param chaos_fault_request: A request object to enable/disable the chaos fault. Required. - :type chaos_fault_request: ~azure.mgmt.cosmosdb.models.ChaosFaultResource - :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 ChaosFaultResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ChaosFaultResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_enable_disable( - self, - resource_group_name: str, - account_name: str, - chaos_fault: str, - chaos_fault_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ChaosFaultResource]: - """Enable, disable Chaos Fault in a CosmosDB account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param chaos_fault: The name of the ChaosFault. Required. - :type chaos_fault: str - :param chaos_fault_request: A request object to enable/disable the chaos fault. Required. - :type chaos_fault_request: 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 ChaosFaultResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ChaosFaultResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_enable_disable( - self, - resource_group_name: str, - account_name: str, - chaos_fault: str, - chaos_fault_request: Union[_models.ChaosFaultResource, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ChaosFaultResource]: - """Enable, disable Chaos Fault in a CosmosDB account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param chaos_fault: The name of the ChaosFault. Required. - :type chaos_fault: str - :param chaos_fault_request: A request object to enable/disable the chaos fault. Is either a - ChaosFaultResource type or a IO[bytes] type. Required. - :type chaos_fault_request: ~azure.mgmt.cosmosdb.models.ChaosFaultResource or IO[bytes] - :return: An instance of LROPoller that returns either ChaosFaultResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ChaosFaultResource] - :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.ChaosFaultResource] = 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._enable_disable_initial( - resource_group_name=resource_group_name, - account_name=account_name, - chaos_fault=chaos_fault, - chaos_fault_request=chaos_fault_request, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ChaosFaultResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, 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.ChaosFaultResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ChaosFaultResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def get( - self, resource_group_name: str, account_name: str, chaos_fault: str, **kwargs: Any - ) -> _models.ChaosFaultResource: - """Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param chaos_fault: The name of the ChaosFault. Required. - :type chaos_fault: str - :return: ChaosFaultResource or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.ChaosFaultResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ChaosFaultResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - chaos_fault=chaos_fault, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ChaosFaultResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_operations.py index b2cdb2e88136..fa38cc4d6bea 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_operations.py @@ -51,7 +51,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -60,7 +60,7 @@ def build_list_metrics_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metrics", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -96,7 +96,7 @@ def build_list_usages_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +105,7 @@ def build_list_usages_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/usages", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -140,7 +140,7 @@ def build_list_metric_definitions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +149,7 @@ def build_list_metric_definitions_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metricDefinitions", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_partition_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_partition_operations.py index 36024135ef0d..944005900ecf 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_partition_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_partition_operations.py @@ -51,7 +51,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -60,7 +60,7 @@ def build_list_metrics_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -96,7 +96,7 @@ def build_list_usages_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +105,7 @@ def build_list_usages_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/usages", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_partition_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_partition_region_operations.py index 42fb451d8f53..ae21a866e363 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_partition_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_partition_region_operations.py @@ -52,7 +52,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +61,7 @@ def build_list_metrics_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_region_operations.py index d975117d7954..00a2c02f8345 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_region_operations.py @@ -52,7 +52,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +61,7 @@ def build_list_metrics_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/metrics", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_data_transfer_jobs_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_data_transfer_jobs_operations.py deleted file mode 100644 index 0c5c5489b190..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_data_transfer_jobs_operations.py +++ /dev/null @@ -1,836 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_request( - resource_group_name: str, account_name: str, job_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", "2024-12-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "jobName": _SERIALIZER.url("job_name", job_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_get_request( - resource_group_name: str, account_name: str, job_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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "jobName": _SERIALIZER.url("job_name", job_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_pause_request( - resource_group_name: str, account_name: str, job_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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/pause", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_resume_request( - resource_group_name: str, account_name: str, job_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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/resume", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_cancel_request( - resource_group_name: str, account_name: str, job_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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/cancel", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_complete_request( - resource_group_name: str, account_name: str, job_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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/complete", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_database_account_request( - resource_group_name: str, account_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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - } - - _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 DataTransferJobsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.CosmosDBManagementClient`'s - :attr:`data_transfer_jobs` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def create( - self, - resource_group_name: str, - account_name: str, - job_name: str, - job_create_parameters: _models.CreateJobRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Creates a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :param job_create_parameters: Required. - :type job_create_parameters: ~azure.mgmt.cosmosdb.models.CreateJobRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create( - self, - resource_group_name: str, - account_name: str, - job_name: str, - job_create_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Creates a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :param job_create_parameters: Required. - :type job_create_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create( - self, - resource_group_name: str, - account_name: str, - job_name: str, - job_create_parameters: Union[_models.CreateJobRequest, IO[bytes]], - **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Creates a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :param job_create_parameters: Is either a CreateJobRequest type or a IO[bytes] type. Required. - :type job_create_parameters: ~azure.mgmt.cosmosdb.models.CreateJobRequest or IO[bytes] - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_create_parameters, (IOBase, bytes)): - _content = job_create_parameters - else: - _json = self._serialize.body(job_create_parameters, "CreateJobRequest") - - _request = build_create_request( - resource_group_name=resource_group_name, - account_name=account_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataTransferJobGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get( - self, resource_group_name: str, account_name: str, job_name: str, **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Get a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataTransferJobGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def pause( - self, resource_group_name: str, account_name: str, job_name: str, **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Pause a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) - - _request = build_pause_request( - resource_group_name=resource_group_name, - account_name=account_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataTransferJobGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def resume( - self, resource_group_name: str, account_name: str, job_name: str, **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Resumes a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) - - _request = build_resume_request( - resource_group_name=resource_group_name, - account_name=account_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataTransferJobGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def cancel( - self, resource_group_name: str, account_name: str, job_name: str, **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Cancels a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) - - _request = build_cancel_request( - resource_group_name=resource_group_name, - account_name=account_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataTransferJobGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def complete( - self, resource_group_name: str, account_name: str, job_name: str, **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Completes a Data Transfer Online Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) - - _request = build_complete_request( - resource_group_name=resource_group_name, - account_name=account_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataTransferJobGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_by_database_account( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> Iterable["_models.DataTransferJobGetResults"]: - """Get a list of Data Transfer jobs. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :return: An iterator like instance of either DataTransferJobGetResults or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.DataTransferJobGetResults] - :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.DataTransferJobFeedResults] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_account_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataTransferJobFeedResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_account_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_account_region_operations.py index 6acaeaa8093e..0d98a48d2dd2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_account_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_account_region_operations.py @@ -44,7 +44,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -53,7 +53,7 @@ def build_list_metrics_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/metrics", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_accounts_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_accounts_operations.py index 44f9cea428bb..d32c2bd512db 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_accounts_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_accounts_operations.py @@ -48,7 +48,7 @@ def build_get_request(resource_group_name: str, account_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -57,7 +57,7 @@ def build_get_request(resource_group_name: str, account_name: str, subscription_ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -83,7 +83,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -93,7 +93,7 @@ def build_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -121,7 +121,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -131,7 +131,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -158,14 +158,14 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -188,7 +188,7 @@ def build_failover_priority_change_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( @@ -196,7 +196,7 @@ def build_failover_priority_change_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -221,13 +221,13 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts") path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -245,7 +245,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -257,7 +257,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -277,7 +277,7 @@ def build_list_keys_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -286,7 +286,7 @@ def build_list_keys_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -312,7 +312,7 @@ def build_list_connection_strings_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -321,7 +321,7 @@ def build_list_connection_strings_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -347,7 +347,7 @@ def build_offline_region_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -357,7 +357,7 @@ def build_offline_region_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -385,7 +385,7 @@ def build_online_region_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -395,7 +395,7 @@ def build_online_region_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -423,7 +423,7 @@ def build_get_read_only_keys_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -432,7 +432,7 @@ def build_get_read_only_keys_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -458,7 +458,7 @@ def build_list_read_only_keys_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -467,7 +467,7 @@ def build_list_read_only_keys_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -493,7 +493,7 @@ def build_regenerate_key_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( @@ -501,7 +501,7 @@ def build_regenerate_key_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -525,7 +525,7 @@ def build_regenerate_key_request( def build_check_name_exists_request(account_name: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) # Construct URL _url = kwargs.pop("template_url", "/providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}") path_format_arguments = { @@ -548,7 +548,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -557,7 +557,7 @@ def build_list_metrics_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -584,7 +584,7 @@ def build_list_usages_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -593,7 +593,7 @@ def build_list_usages_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -621,7 +621,7 @@ def build_list_metric_definitions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -630,7 +630,7 @@ def build_list_metric_definitions_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1752,7 +1752,7 @@ def _offline_region_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1948,7 +1948,7 @@ def _online_region_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_operations.py index bf8bff596b63..bd3df66911cd 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_operations.py @@ -44,7 +44,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -53,7 +53,7 @@ def build_list_metrics_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metrics", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -87,7 +87,7 @@ def build_list_usages_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +96,7 @@ def build_list_usages_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/usages", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -125,7 +125,7 @@ def build_list_metric_definitions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -134,7 +134,7 @@ def build_list_metric_definitions_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metricDefinitions", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_graph_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_graph_resources_operations.py deleted file mode 100644 index 9f6d8471f342..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_graph_resources_operations.py +++ /dev/null @@ -1,679 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_graphs_request( - resource_group_name: str, account_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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - } - - _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_graph_request( - resource_group_name: str, account_name: str, graph_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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_update_graph_request( - resource_group_name: str, account_name: str, graph_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", "2024-12-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_graph_resource_request( - resource_group_name: str, account_name: str, graph_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -class GraphResourcesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.CosmosDBManagementClient`'s - :attr:`graph_resources` 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_graphs( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> Iterable["_models.GraphResourceGetResults"]: - """Lists the graphs under an existing Azure Cosmos DB database account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :return: An iterator like instance of either GraphResourceGetResults or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.GraphResourceGetResults] - :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.GraphResourcesListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_graphs_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("GraphResourcesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_graph( - self, resource_group_name: str, account_name: str, graph_name: str, **kwargs: Any - ) -> _models.GraphResourceGetResults: - """Gets the Graph resource under an existing Azure Cosmos DB database account with the provided - name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param graph_name: Cosmos DB graph resource name. Required. - :type graph_name: str - :return: GraphResourceGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.GraphResourceGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.GraphResourceGetResults] = kwargs.pop("cls", None) - - _request = build_get_graph_request( - resource_group_name=resource_group_name, - account_name=account_name, - graph_name=graph_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("GraphResourceGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_update_graph_initial( - self, - resource_group_name: str, - account_name: str, - graph_name: str, - create_update_graph_parameters: Union[_models.GraphResourceCreateUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(create_update_graph_parameters, (IOBase, bytes)): - _content = create_update_graph_parameters - else: - _json = self._serialize.body(create_update_graph_parameters, "GraphResourceCreateUpdateParameters") - - _request = build_create_update_graph_request( - resource_group_name=resource_group_name, - account_name=account_name, - graph_name=graph_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_update_graph( - self, - resource_group_name: str, - account_name: str, - graph_name: str, - create_update_graph_parameters: _models.GraphResourceCreateUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GraphResourceGetResults]: - """Create or update an Azure Cosmos DB Graph. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param graph_name: Cosmos DB graph resource name. Required. - :type graph_name: str - :param create_update_graph_parameters: The parameters to provide for the current graph. - Required. - :type create_update_graph_parameters: - ~azure.mgmt.cosmosdb.models.GraphResourceCreateUpdateParameters - :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 GraphResourceGetResults or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.GraphResourceGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_update_graph( - self, - resource_group_name: str, - account_name: str, - graph_name: str, - create_update_graph_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GraphResourceGetResults]: - """Create or update an Azure Cosmos DB Graph. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param graph_name: Cosmos DB graph resource name. Required. - :type graph_name: str - :param create_update_graph_parameters: The parameters to provide for the current graph. - Required. - :type create_update_graph_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either GraphResourceGetResults or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.GraphResourceGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_update_graph( - self, - resource_group_name: str, - account_name: str, - graph_name: str, - create_update_graph_parameters: Union[_models.GraphResourceCreateUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.GraphResourceGetResults]: - """Create or update an Azure Cosmos DB Graph. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param graph_name: Cosmos DB graph resource name. Required. - :type graph_name: str - :param create_update_graph_parameters: The parameters to provide for the current graph. Is - either a GraphResourceCreateUpdateParameters type or a IO[bytes] type. Required. - :type create_update_graph_parameters: - ~azure.mgmt.cosmosdb.models.GraphResourceCreateUpdateParameters or IO[bytes] - :return: An instance of LROPoller that returns either GraphResourceGetResults or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.GraphResourceGetResults] - :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.GraphResourceGetResults] = 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_update_graph_initial( - resource_group_name=resource_group_name, - account_name=account_name, - graph_name=graph_name, - create_update_graph_parameters=create_update_graph_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GraphResourceGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.GraphResourceGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.GraphResourceGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_graph_resource_initial( - self, resource_group_name: str, account_name: str, graph_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_graph_resource_request( - resource_group_name=resource_group_name, - account_name=account_name, - graph_name=graph_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete_graph_resource( - self, resource_group_name: str, account_name: str, graph_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes an existing Azure Cosmos DB Graph Resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param graph_name: Cosmos DB graph resource name. Required. - :type graph_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._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_graph_resource_initial( - resource_group_name=resource_group_name, - account_name=account_name, - graph_name=graph_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_gremlin_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_gremlin_resources_operations.py index 47c59fb336c8..4c2db47b95d4 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_gremlin_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_gremlin_resources_operations.py @@ -50,7 +50,7 @@ def build_list_gremlin_databases_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +59,7 @@ def build_list_gremlin_databases_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -85,7 +85,7 @@ def build_get_gremlin_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +94,7 @@ def build_get_gremlin_database_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -121,7 +121,7 @@ def build_create_update_gremlin_database_request( # pylint: disable=name-too-lo _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -131,7 +131,7 @@ def build_create_update_gremlin_database_request( # pylint: disable=name-too-lo "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -159,14 +159,14 @@ def build_delete_gremlin_database_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -190,7 +190,7 @@ def build_get_gremlin_database_throughput_request( # pylint: disable=name-too-l _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -199,7 +199,7 @@ def build_get_gremlin_database_throughput_request( # pylint: disable=name-too-l "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -226,7 +226,7 @@ def build_update_gremlin_database_throughput_request( # pylint: disable=name-to _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -236,7 +236,7 @@ def build_update_gremlin_database_throughput_request( # pylint: disable=name-to "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -265,7 +265,7 @@ def build_migrate_gremlin_database_to_autoscale_request( # pylint: disable=name _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -274,7 +274,7 @@ def build_migrate_gremlin_database_to_autoscale_request( # pylint: disable=name "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -301,7 +301,7 @@ def build_migrate_gremlin_database_to_manual_throughput_request( # pylint: disa _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -310,7 +310,7 @@ def build_migrate_gremlin_database_to_manual_throughput_request( # pylint: disa "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -337,7 +337,7 @@ def build_list_gremlin_graphs_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -346,7 +346,7 @@ def build_list_gremlin_graphs_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -378,7 +378,7 @@ def build_get_gremlin_graph_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -387,7 +387,7 @@ def build_get_gremlin_graph_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -420,7 +420,7 @@ def build_create_update_gremlin_graph_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -430,7 +430,7 @@ def build_create_update_gremlin_graph_request( # pylint: disable=name-too-long "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -464,14 +464,14 @@ def build_delete_gremlin_graph_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -501,7 +501,7 @@ def build_get_gremlin_graph_throughput_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -510,7 +510,7 @@ def build_get_gremlin_graph_throughput_request( # pylint: disable=name-too-long "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -543,7 +543,7 @@ def build_update_gremlin_graph_throughput_request( # pylint: disable=name-too-l _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -553,7 +553,7 @@ def build_update_gremlin_graph_throughput_request( # pylint: disable=name-too-l "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -588,7 +588,7 @@ def build_migrate_gremlin_graph_to_autoscale_request( # pylint: disable=name-to _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -597,7 +597,7 @@ def build_migrate_gremlin_graph_to_autoscale_request( # pylint: disable=name-to "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToAutoscale", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -630,7 +630,7 @@ def build_migrate_gremlin_graph_to_manual_throughput_request( # pylint: disable _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -639,7 +639,7 @@ def build_migrate_gremlin_graph_to_manual_throughput_request( # pylint: disable "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToManualThroughput", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -672,7 +672,7 @@ def build_retrieve_continuous_backup_information_request( # pylint: disable=nam _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -682,7 +682,7 @@ def build_retrieve_continuous_backup_information_request( # pylint: disable=nam "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/retrieveContinuousBackupInformation", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_locations_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_locations_operations.py index a33a23db87c1..0e06d928a2a7 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_locations_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_locations_operations.py @@ -42,13 +42,13 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations") path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -66,7 +66,7 @@ def build_get_request(location: str, subscription_id: str, **kwargs: Any) -> Htt _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +74,7 @@ def build_get_request(location: str, subscription_id: str, **kwargs: Any) -> Htt "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}" ) path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "location": _SERIALIZER.url("location", location, "str"), } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_mongo_db_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_mongo_db_resources_operations.py index e2b4f01d3981..1849cf74c03c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_mongo_db_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_mongo_db_resources_operations.py @@ -50,7 +50,7 @@ def build_list_mongo_db_databases_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +59,7 @@ def build_list_mongo_db_databases_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -85,7 +85,7 @@ def build_get_mongo_db_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +94,7 @@ def build_get_mongo_db_database_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -121,7 +121,7 @@ def build_create_update_mongo_db_database_request( # pylint: disable=name-too-l _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -131,7 +131,7 @@ def build_create_update_mongo_db_database_request( # pylint: disable=name-too-l "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -159,14 +159,14 @@ def build_delete_mongo_db_database_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -190,7 +190,7 @@ def build_get_mongo_db_database_throughput_request( # pylint: disable=name-too- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -199,7 +199,7 @@ def build_get_mongo_db_database_throughput_request( # pylint: disable=name-too- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -226,7 +226,7 @@ def build_update_mongo_db_database_throughput_request( # pylint: disable=name-t _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -236,7 +236,7 @@ def build_update_mongo_db_database_throughput_request( # pylint: disable=name-t "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -265,7 +265,7 @@ def build_migrate_mongo_db_database_to_autoscale_request( # pylint: disable=nam _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -274,7 +274,7 @@ def build_migrate_mongo_db_database_to_autoscale_request( # pylint: disable=nam "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -301,7 +301,7 @@ def build_migrate_mongo_db_database_to_manual_throughput_request( # pylint: dis _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -310,7 +310,7 @@ def build_migrate_mongo_db_database_to_manual_throughput_request( # pylint: dis "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -331,181 +331,13 @@ def build_migrate_mongo_db_database_to_manual_throughput_request( # pylint: dis return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_mongo_db_database_retrieve_throughput_distribution_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, database_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", "2024-12-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "databaseName": _SERIALIZER.url("database_name", database_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_mongo_db_database_redistribute_throughput_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, database_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", "2024-12-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/redistributeThroughput", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "databaseName": _SERIALIZER.url("database_name", database_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_mongo_db_container_retrieve_throughput_distribution_request( # pylint: disable=name-too-long - resource_group_name: str, - account_name: str, - database_name: str, - collection_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", "2024-12-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "collectionName": _SERIALIZER.url("collection_name", collection_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_mongo_db_container_redistribute_throughput_request( # pylint: disable=name-too-long - resource_group_name: str, - account_name: str, - database_name: str, - collection_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", "2024-12-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "collectionName": _SERIALIZER.url("collection_name", collection_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_list_mongo_db_collections_request( resource_group_name: str, account_name: str, database_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", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -514,7 +346,7 @@ def build_list_mongo_db_collections_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -546,7 +378,7 @@ def build_get_mongo_db_collection_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -555,7 +387,7 @@ def build_get_mongo_db_collection_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -588,7 +420,7 @@ def build_create_update_mongo_db_collection_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -598,7 +430,7 @@ def build_create_update_mongo_db_collection_request( # pylint: disable=name-too "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -632,14 +464,14 @@ def build_delete_mongo_db_collection_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -658,90 +490,6 @@ def build_delete_mongo_db_collection_request( return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_mongo_db_database_partition_merge_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, database_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", "2024-12-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/partitionMerge", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "databaseName": _SERIALIZER.url("database_name", database_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_list_mongo_db_collection_partition_merge_request( # pylint: disable=name-too-long - resource_group_name: str, - account_name: str, - database_name: str, - collection_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", "2024-12-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "collectionName": _SERIALIZER.url("collection_name", collection_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - def build_get_mongo_db_collection_throughput_request( # pylint: disable=name-too-long resource_group_name: str, account_name: str, @@ -753,7 +501,7 @@ def build_get_mongo_db_collection_throughput_request( # pylint: disable=name-to _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -762,7 +510,7 @@ def build_get_mongo_db_collection_throughput_request( # pylint: disable=name-to "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -795,7 +543,7 @@ def build_update_mongo_db_collection_throughput_request( # pylint: disable=name _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -805,7 +553,7 @@ def build_update_mongo_db_collection_throughput_request( # pylint: disable=name "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -840,7 +588,7 @@ def build_migrate_mongo_db_collection_to_autoscale_request( # pylint: disable=n _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -849,7 +597,7 @@ def build_migrate_mongo_db_collection_to_autoscale_request( # pylint: disable=n "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToAutoscale", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -882,7 +630,7 @@ def build_migrate_mongo_db_collection_to_manual_throughput_request( # pylint: d _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -891,7 +639,7 @@ def build_migrate_mongo_db_collection_to_manual_throughput_request( # pylint: d "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToManualThroughput", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -919,7 +667,7 @@ def build_get_mongo_role_definition_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -929,7 +677,7 @@ def build_get_mongo_role_definition_request( ) # pylint: disable=line-too-long path_format_arguments = { "mongoRoleDefinitionId": _SERIALIZER.url("mongo_role_definition_id", mongo_role_definition_id, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -955,7 +703,7 @@ def build_create_update_mongo_role_definition_request( # pylint: disable=name-t _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -966,7 +714,7 @@ def build_create_update_mongo_role_definition_request( # pylint: disable=name-t ) # pylint: disable=line-too-long path_format_arguments = { "mongoRoleDefinitionId": _SERIALIZER.url("mongo_role_definition_id", mongo_role_definition_id, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -994,7 +742,7 @@ def build_delete_mongo_role_definition_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1004,7 +752,7 @@ def build_delete_mongo_role_definition_request( # pylint: disable=name-too-long ) # pylint: disable=line-too-long path_format_arguments = { "mongoRoleDefinitionId": _SERIALIZER.url("mongo_role_definition_id", mongo_role_definition_id, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1030,7 +778,7 @@ def build_list_mongo_role_definitions_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1039,7 +787,7 @@ def build_list_mongo_role_definitions_request( # pylint: disable=name-too-long "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1065,7 +813,7 @@ def build_get_mongo_user_definition_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1075,7 +823,7 @@ def build_get_mongo_user_definition_request( ) # pylint: disable=line-too-long path_format_arguments = { "mongoUserDefinitionId": _SERIALIZER.url("mongo_user_definition_id", mongo_user_definition_id, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1101,7 +849,7 @@ def build_create_update_mongo_user_definition_request( # pylint: disable=name-t _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -1112,7 +860,7 @@ def build_create_update_mongo_user_definition_request( # pylint: disable=name-t ) # pylint: disable=line-too-long path_format_arguments = { "mongoUserDefinitionId": _SERIALIZER.url("mongo_user_definition_id", mongo_user_definition_id, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1140,7 +888,7 @@ def build_delete_mongo_user_definition_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1150,7 +898,7 @@ def build_delete_mongo_user_definition_request( # pylint: disable=name-too-long ) # pylint: disable=line-too-long path_format_arguments = { "mongoUserDefinitionId": _SERIALIZER.url("mongo_user_definition_id", mongo_user_definition_id, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1176,7 +924,7 @@ def build_list_mongo_user_definitions_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1185,7 +933,7 @@ def build_list_mongo_user_definitions_request( # pylint: disable=name-too-long "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1216,7 +964,7 @@ def build_retrieve_continuous_backup_information_request( # pylint: disable=nam _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -1226,7 +974,7 @@ def build_retrieve_continuous_backup_information_request( # pylint: disable=nam "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/retrieveContinuousBackupInformation", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -2267,917 +2015,11 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _mongo_db_database_retrieve_throughput_distribution_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(retrieve_throughput_parameters, (IOBase, bytes)): - _content = retrieve_throughput_parameters - else: - _json = self._serialize.body(retrieve_throughput_parameters, "RetrieveThroughputParameters") - - _request = build_mongo_db_database_retrieve_throughput_distribution_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_mongo_db_database_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: _models.RetrieveThroughputParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current MongoDB database. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - :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 PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_mongo_db_database_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current MongoDB database. Required. - :type retrieve_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_mongo_db_database_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current MongoDB database. Is either a RetrieveThroughputParameters type or - a IO[bytes] type. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - or IO[bytes] - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :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.PhysicalPartitionThroughputInfoResult] = 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._mongo_db_database_retrieve_throughput_distribution_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - retrieve_throughput_parameters=retrieve_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, 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.PhysicalPartitionThroughputInfoResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.PhysicalPartitionThroughputInfoResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _mongo_db_database_redistribute_throughput_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(redistribute_throughput_parameters, (IOBase, bytes)): - _content = redistribute_throughput_parameters - else: - _json = self._serialize.body(redistribute_throughput_parameters, "RedistributeThroughputParameters") - - _request = build_mongo_db_database_redistribute_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_mongo_db_database_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: _models.RedistributeThroughputParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB MongoDB database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current MongoDB database. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters - :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 PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_mongo_db_database_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB MongoDB database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current MongoDB database. Required. - :type redistribute_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_mongo_db_database_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB MongoDB database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current MongoDB database. Is either a RedistributeThroughputParameters type - or a IO[bytes] type. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters or IO[bytes] - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :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.PhysicalPartitionThroughputInfoResult] = 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._mongo_db_database_redistribute_throughput_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - redistribute_throughput_parameters=redistribute_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, 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.PhysicalPartitionThroughputInfoResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.PhysicalPartitionThroughputInfoResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _mongo_db_container_retrieve_throughput_distribution_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(retrieve_throughput_parameters, (IOBase, bytes)): - _content = retrieve_throughput_parameters - else: - _json = self._serialize.body(retrieve_throughput_parameters, "RetrieveThroughputParameters") - - _request = build_mongo_db_container_retrieve_throughput_distribution_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_mongo_db_container_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - retrieve_throughput_parameters: _models.RetrieveThroughputParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current MongoDB container. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - :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 PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_mongo_db_container_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - retrieve_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current MongoDB container. Required. - :type retrieve_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_mongo_db_container_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current MongoDB container. Is either a RetrieveThroughputParameters type - or a IO[bytes] type. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - or IO[bytes] - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :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.PhysicalPartitionThroughputInfoResult] = 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._mongo_db_container_retrieve_throughput_distribution_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - retrieve_throughput_parameters=retrieve_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, 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.PhysicalPartitionThroughputInfoResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.PhysicalPartitionThroughputInfoResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _mongo_db_container_redistribute_throughput_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(redistribute_throughput_parameters, (IOBase, bytes)): - _content = redistribute_throughput_parameters - else: - _json = self._serialize.body(redistribute_throughput_parameters, "RedistributeThroughputParameters") - - _request = build_mongo_db_container_redistribute_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_mongo_db_container_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - redistribute_throughput_parameters: _models.RedistributeThroughputParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB MongoDB container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current MongoDB container. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters - :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 PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_mongo_db_container_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - redistribute_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB MongoDB container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current MongoDB container. Required. - :type redistribute_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_mongo_db_container_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB MongoDB container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current MongoDB container. Is either a RedistributeThroughputParameters type - or a IO[bytes] type. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters or IO[bytes] - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :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.PhysicalPartitionThroughputInfoResult] = 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._mongo_db_container_redistribute_throughput_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - redistribute_throughput_parameters=redistribute_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, 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.PhysicalPartitionThroughputInfoResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.PhysicalPartitionThroughputInfoResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def list_mongo_db_collections( - self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any - ) -> Iterable["_models.MongoDBCollectionGetResults"]: - """Lists the MongoDB collection under an existing Azure Cosmos DB database account. + @distributed_trace + def list_mongo_db_collections( + self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any + ) -> Iterable["_models.MongoDBCollectionGetResults"]: + """Lists the MongoDB collection under an existing Azure Cosmos DB database account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3194,144 +2036,9 @@ def list_mongo_db_collections( _headers = 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.MongoDBCollectionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_mongo_db_collections_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("MongoDBCollectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_mongo_db_collection( - self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any - ) -> _models.MongoDBCollectionGetResults: - """Gets the MongoDB collection under an existing Azure Cosmos DB database account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :return: MongoDBCollectionGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MongoDBCollectionGetResults] = kwargs.pop("cls", None) - - _request = build_get_mongo_db_collection_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("MongoDBCollectionGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.MongoDBCollectionListResult] = kwargs.pop("cls", None) - def _create_update_mongo_db_collection_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - create_update_mongo_db_collection_parameters: Union[_models.MongoDBCollectionCreateUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -3340,150 +2047,66 @@ def _create_update_mongo_db_collection_initial( # pylint: disable=name-too-long } 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[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(create_update_mongo_db_collection_parameters, (IOBase, bytes)): - _content = create_update_mongo_db_collection_parameters - else: - _json = self._serialize.body( - create_update_mongo_db_collection_parameters, "MongoDBCollectionCreateUpdateParameters" - ) + def prepare_request(next_link=None): + if not next_link: - _request = build_create_update_mongo_db_collection_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + _request = build_list_mongo_db_collections_request( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request - response = pipeline_response.http_response + def extract_data(pipeline_response): + deserialized = self._deserialize("MongoDBCollectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return None, iter(list_of_elem) - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + def get_next(next_link=None): + _request = prepare_request(next_link) - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_update_mongo_db_collection( - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - create_update_mongo_db_collection_parameters: _models.MongoDBCollectionCreateUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.MongoDBCollectionGetResults]: - """Create or update an Azure Cosmos DB MongoDB Collection. + response = pipeline_response.http_response - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param create_update_mongo_db_collection_parameters: The parameters to provide for the current - MongoDB Collection. Required. - :type create_update_mongo_db_collection_parameters: - ~azure.mgmt.cosmosdb.models.MongoDBCollectionCreateUpdateParameters - :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 MongoDBCollectionGetResults or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - @overload - def begin_create_update_mongo_db_collection( - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - create_update_mongo_db_collection_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.MongoDBCollectionGetResults]: - """Create or update an Azure Cosmos DB MongoDB Collection. + return pipeline_response - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param create_update_mongo_db_collection_parameters: The parameters to provide for the current - MongoDB Collection. Required. - :type create_update_mongo_db_collection_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either MongoDBCollectionGetResults or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ + return ItemPaged(get_next, extract_data) @distributed_trace - def begin_create_update_mongo_db_collection( - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - create_update_mongo_db_collection_parameters: Union[_models.MongoDBCollectionCreateUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.MongoDBCollectionGetResults]: - """Create or update an Azure Cosmos DB MongoDB Collection. + def get_mongo_db_collection( + self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any + ) -> _models.MongoDBCollectionGetResults: + """Gets the MongoDB collection under an existing Azure Cosmos DB database account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3494,68 +2117,10 @@ def begin_create_update_mongo_db_collection( :type database_name: str :param collection_name: Cosmos DB collection name. Required. :type collection_name: str - :param create_update_mongo_db_collection_parameters: The parameters to provide for the current - MongoDB Collection. Is either a MongoDBCollectionCreateUpdateParameters type or a IO[bytes] - type. Required. - :type create_update_mongo_db_collection_parameters: - ~azure.mgmt.cosmosdb.models.MongoDBCollectionCreateUpdateParameters or IO[bytes] - :return: An instance of LROPoller that returns either MongoDBCollectionGetResults or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] + :return: MongoDBCollectionGetResults or the result of cls(response) + :rtype: ~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults :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.MongoDBCollectionGetResults] = 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_update_mongo_db_collection_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - create_update_mongo_db_collection_parameters=create_update_mongo_db_collection_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("MongoDBCollectionGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.MongoDBCollectionGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.MongoDBCollectionGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_mongo_db_collection_initial( - self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any - ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -3568,9 +2133,9 @@ def _delete_mongo_db_collection_initial( _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[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.MongoDBCollectionGetResults] = kwargs.pop("cls", None) - _request = build_delete_mongo_db_collection_request( + _request = build_get_mongo_db_collection_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3582,103 +2147,31 @@ def _delete_mongo_db_collection_initial( ) _request.url = self._client.format_url(_request.url) - _decompress = kwargs.pop("decompress", True) - _stream = True + _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]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + deserialized = self._deserialize("MongoDBCollectionGetResults", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace - def begin_delete_mongo_db_collection( - self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes an existing Azure Cosmos DB MongoDB Collection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._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_mongo_db_collection_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _mongo_db_database_partition_merge_initial( # pylint: disable=name-too-long + def _create_update_mongo_db_collection_initial( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, database_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], + collection_name: str, + create_update_mongo_db_collection_parameters: Union[_models.MongoDBCollectionCreateUpdateParameters, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -3699,15 +2192,18 @@ def _mongo_db_database_partition_merge_initial( # pylint: disable=name-too-long content_type = content_type or "application/json" _json = None _content = None - if isinstance(merge_parameters, (IOBase, bytes)): - _content = merge_parameters + if isinstance(create_update_mongo_db_collection_parameters, (IOBase, bytes)): + _content = create_update_mongo_db_collection_parameters else: - _json = self._serialize.body(merge_parameters, "MergeParameters") + _json = self._serialize.body( + create_update_mongo_db_collection_parameters, "MongoDBCollectionCreateUpdateParameters" + ) - _request = build_mongo_db_database_partition_merge_request( + _request = build_create_update_mongo_db_collection_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, + collection_name=collection_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, @@ -3749,17 +2245,18 @@ def _mongo_db_database_partition_merge_initial( # pylint: disable=name-too-long return deserialized # type: ignore @overload - def begin_mongo_db_database_partition_merge( + def begin_create_update_mongo_db_collection( self, resource_group_name: str, account_name: str, database_name: str, - merge_parameters: _models.MergeParameters, + collection_name: str, + create_update_mongo_db_collection_parameters: _models.MongoDBCollectionCreateUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a MongoDB database. + ) -> LROPoller[_models.MongoDBCollectionGetResults]: + """Create or update an Azure Cosmos DB MongoDB Collection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3768,30 +2265,34 @@ def begin_mongo_db_database_partition_merge( :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters + :param collection_name: Cosmos DB collection name. Required. + :type collection_name: str + :param create_update_mongo_db_collection_parameters: The parameters to provide for the current + MongoDB Collection. Required. + :type create_update_mongo_db_collection_parameters: + ~azure.mgmt.cosmosdb.models.MongoDBCollectionCreateUpdateParameters :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 PhysicalPartitionStorageInfoCollection or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] + :return: An instance of LROPoller that returns either MongoDBCollectionGetResults or the result + of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_mongo_db_database_partition_merge( + def begin_create_update_mongo_db_collection( self, resource_group_name: str, account_name: str, database_name: str, - merge_parameters: IO[bytes], + collection_name: str, + create_update_mongo_db_collection_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a MongoDB database. + ) -> LROPoller[_models.MongoDBCollectionGetResults]: + """Create or update an Azure Cosmos DB MongoDB Collection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3800,28 +2301,31 @@ def begin_mongo_db_database_partition_merge( :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: IO[bytes] + :param collection_name: Cosmos DB collection name. Required. + :type collection_name: str + :param create_update_mongo_db_collection_parameters: The parameters to provide for the current + MongoDB Collection. Required. + :type create_update_mongo_db_collection_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionStorageInfoCollection or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] + :return: An instance of LROPoller that returns either MongoDBCollectionGetResults or the result + of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_mongo_db_database_partition_merge( + def begin_create_update_mongo_db_collection( self, resource_group_name: str, account_name: str, database_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], + collection_name: str, + create_update_mongo_db_collection_parameters: Union[_models.MongoDBCollectionCreateUpdateParameters, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a MongoDB database. + ) -> LROPoller[_models.MongoDBCollectionGetResults]: + """Create or update an Azure Cosmos DB MongoDB Collection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3830,13 +2334,16 @@ def begin_mongo_db_database_partition_merge( :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param merge_parameters: The parameters for the merge operation. Is either a MergeParameters - type or a IO[bytes] type. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters or IO[bytes] - :return: An instance of LROPoller that returns either PhysicalPartitionStorageInfoCollection or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] + :param collection_name: Cosmos DB collection name. Required. + :type collection_name: str + :param create_update_mongo_db_collection_parameters: The parameters to provide for the current + MongoDB Collection. Is either a MongoDBCollectionCreateUpdateParameters type or a IO[bytes] + type. Required. + :type create_update_mongo_db_collection_parameters: + ~azure.mgmt.cosmosdb.models.MongoDBCollectionCreateUpdateParameters or IO[bytes] + :return: An instance of LROPoller that returns either MongoDBCollectionGetResults or the result + of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3844,16 +2351,17 @@ def begin_mongo_db_database_partition_merge( 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.PhysicalPartitionStorageInfoCollection] = kwargs.pop("cls", None) + cls: ClsType[_models.MongoDBCollectionGetResults] = 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._mongo_db_database_partition_merge_initial( + raw_result = self._create_update_mongo_db_collection_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, - merge_parameters=merge_parameters, + collection_name=collection_name, + create_update_mongo_db_collection_parameters=create_update_mongo_db_collection_parameters, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -3865,38 +2373,30 @@ def begin_mongo_db_database_partition_merge( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionStorageInfoCollection", pipeline_response.http_response) + deserialized = self._deserialize("MongoDBCollectionGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: polling_method = polling if cont_token: - return LROPoller[_models.PhysicalPartitionStorageInfoCollection].from_continuation_token( + return LROPoller[_models.MongoDBCollectionGetResults].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.PhysicalPartitionStorageInfoCollection]( + return LROPoller[_models.MongoDBCollectionGetResults]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _list_mongo_db_collection_partition_merge_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], - **kwargs: Any + def _delete_mongo_db_collection_initial( + self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3906,31 +2406,19 @@ def _list_mongo_db_collection_partition_merge_initial( # pylint: disable=name-t } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) 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)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(merge_parameters, (IOBase, bytes)): - _content = merge_parameters - else: - _json = self._serialize.body(merge_parameters, "MergeParameters") - - _request = build_list_mongo_db_collection_partition_merge_request( + _request = build_delete_mongo_db_collection_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, collection_name=collection_name, subscription_id=self._config.subscription_id, api_version=api_version, - content_type=content_type, - json=_json, - content=_content, headers=_headers, params=_params, ) @@ -3944,7 +2432,7 @@ def _list_mongo_db_collection_partition_merge_initial( # pylint: disable=name-t response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -3966,87 +2454,11 @@ def _list_mongo_db_collection_partition_merge_initial( # pylint: disable=name-t return deserialized # type: ignore - @overload - def begin_list_mongo_db_collection_partition_merge( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - merge_parameters: _models.MergeParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a MongoDB Collection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters - :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 PhysicalPartitionStorageInfoCollection or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_list_mongo_db_collection_partition_merge( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - merge_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a MongoDB Collection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionStorageInfoCollection or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - def begin_list_mongo_db_collection_partition_merge( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a MongoDB Collection. + def begin_delete_mongo_db_collection( + self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes an existing Azure Cosmos DB MongoDB Collection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -4057,33 +2469,25 @@ def begin_list_mongo_db_collection_partition_merge( # pylint: disable=name-too- :type database_name: str :param collection_name: Cosmos DB collection name. Required. :type collection_name: str - :param merge_parameters: The parameters for the merge operation. Is either a MergeParameters - type or a IO[bytes] type. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters or IO[bytes] - :return: An instance of LROPoller that returns either PhysicalPartitionStorageInfoCollection or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = 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.PhysicalPartitionStorageInfoCollection] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._list_mongo_db_collection_partition_merge_initial( + raw_result = self._delete_mongo_db_collection_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, collection_name=collection_name, - merge_parameters=merge_parameters, api_version=api_version, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -4092,30 +2496,24 @@ def begin_list_mongo_db_collection_partition_merge( # pylint: disable=name-too- raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionStorageInfoCollection", pipeline_response.http_response) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: polling_method = polling if cont_token: - return LROPoller[_models.PhysicalPartitionStorageInfoCollection].from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.PhysicalPartitionStorageInfoCollection]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def get_mongo_db_collection_throughput( diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_network_security_perimeter_configurations_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_network_security_perimeter_configurations_operations.py deleted file mode 100644 index 787c67acc437..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_network_security_perimeter_configurations_operations.py +++ /dev/null @@ -1,461 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Iterator, Optional, TypeVar, Union, cast -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request(resource_group_name: str, account_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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - } - - _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, - account_name: str, - network_security_perimeter_configuration_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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "networkSecurityPerimeterConfigurationName": _SERIALIZER.url( - "network_security_perimeter_configuration_name", - network_security_perimeter_configuration_name, - "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_reconcile_request( - resource_group_name: str, - account_name: str, - network_security_perimeter_configuration_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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "networkSecurityPerimeterConfigurationName": _SERIALIZER.url( - "network_security_perimeter_configuration_name", - network_security_perimeter_configuration_name, - "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 NetworkSecurityPerimeterConfigurationsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.CosmosDBManagementClient`'s - :attr:`network_security_perimeter_configurations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> Iterable["_models.NetworkSecurityPerimeterConfiguration"]: - """Gets list of effective Network Security Perimeter Configuration for cosmos db account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :return: An iterator like instance of either NetworkSecurityPerimeterConfiguration or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.NetworkSecurityPerimeterConfiguration] - :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.NetworkSecurityPerimeterConfigurationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkSecurityPerimeterConfigurationListResult", 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, - account_name: str, - network_security_perimeter_configuration_name: str, - **kwargs: Any - ) -> _models.NetworkSecurityPerimeterConfiguration: - """Gets effective Network Security Perimeter Configuration for association. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param network_security_perimeter_configuration_name: The name for Network Security Perimeter - configuration. Required. - :type network_security_perimeter_configuration_name: str - :return: NetworkSecurityPerimeterConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.NetworkSecurityPerimeterConfiguration - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkSecurityPerimeterConfiguration] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - network_security_perimeter_configuration_name=network_security_perimeter_configuration_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("NetworkSecurityPerimeterConfiguration", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _reconcile_initial( - self, - resource_group_name: str, - account_name: str, - network_security_perimeter_configuration_name: str, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_reconcile_request( - resource_group_name=resource_group_name, - account_name=account_name, - network_security_perimeter_configuration_name=network_security_perimeter_configuration_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_reconcile( - self, - resource_group_name: str, - account_name: str, - network_security_perimeter_configuration_name: str, - **kwargs: Any - ) -> LROPoller[None]: - """Refreshes any information about the association. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param network_security_perimeter_configuration_name: The name for Network Security Perimeter - configuration. Required. - :type network_security_perimeter_configuration_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._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._reconcile_initial( - resource_group_name=resource_group_name, - account_name=account_name, - network_security_perimeter_configuration_name=network_security_perimeter_configuration_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, 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/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_notebook_workspaces_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_notebook_workspaces_operations.py index 44b0aa2abc35..0e52af264195 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_notebook_workspaces_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_notebook_workspaces_operations.py @@ -50,7 +50,7 @@ def build_list_by_database_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +59,7 @@ def build_list_by_database_account_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -89,7 +89,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +98,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -129,7 +129,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -139,7 +139,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -172,7 +172,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,7 +181,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -212,7 +212,7 @@ def build_list_connection_info_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -221,7 +221,7 @@ def build_list_connection_info_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/listConnectionInfo", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -252,7 +252,7 @@ def build_regenerate_auth_token_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -261,7 +261,7 @@ def build_regenerate_auth_token_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -292,7 +292,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -301,7 +301,7 @@ def build_start_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/start", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -418,7 +418,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.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -481,7 +481,7 @@ def get( 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.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("NotebookWorkspace", pipeline_response.http_response) @@ -550,7 +550,7 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) @@ -750,7 +750,7 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) @@ -879,7 +879,7 @@ def list_connection_info( 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.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("NotebookWorkspaceConnectionInfoResult", pipeline_response.http_response) @@ -935,7 +935,7 @@ def _regenerate_auth_token_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) @@ -1054,7 +1054,7 @@ def _start_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_operations.py index 2fc1b8b87e7e..40a3e7b5341b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_operations.py @@ -42,7 +42,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_partition_key_range_id_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_partition_key_range_id_operations.py index 7b3f17e06782..1aae3838030c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_partition_key_range_id_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_partition_key_range_id_operations.py @@ -52,7 +52,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +61,7 @@ def build_list_metrics_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_partition_key_range_id_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_partition_key_range_id_region_operations.py index 868a395fdf97..74b724ff8539 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_partition_key_range_id_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_partition_key_range_id_region_operations.py @@ -53,7 +53,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_list_metrics_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_operations.py index 96cfa6b3436e..5d8d4d9d0e3c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_operations.py @@ -44,7 +44,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -53,7 +53,7 @@ def build_list_metrics_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/percentile/metrics", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_source_target_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_source_target_operations.py index fc802d126ced..2e9e487871fc 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_source_target_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_source_target_operations.py @@ -51,7 +51,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -60,7 +60,7 @@ def build_list_metrics_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sourceRegion/{sourceRegion}/targetRegion/{targetRegion}/percentile/metrics", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_target_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_target_operations.py index ffd2e926b097..d55eab9d420a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_target_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_target_operations.py @@ -44,7 +44,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -53,7 +53,7 @@ def build_list_metrics_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/targetRegion/{targetRegion}/percentile/metrics", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_private_endpoint_connections_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_private_endpoint_connections_operations.py index 071fb8c5de91..cdb694f14772 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_private_endpoint_connections_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_private_endpoint_connections_operations.py @@ -49,7 +49,7 @@ def build_list_by_database_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +58,7 @@ def build_list_by_database_account_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -88,7 +88,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +97,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -130,7 +130,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -140,7 +140,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -175,7 +175,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -184,7 +184,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -429,7 +429,7 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) @@ -616,7 +616,7 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_private_link_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_private_link_resources_operations.py index f5e65e201e88..8a43e289ebcc 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_private_link_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_private_link_resources_operations.py @@ -44,7 +44,7 @@ def build_list_by_database_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -53,7 +53,7 @@ def build_list_by_database_account_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateLinkResources", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -79,7 +79,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +88,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateLinkResources/{groupName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_database_accounts_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_database_accounts_operations.py index ad8edbcefefe..9a4be15999d9 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_database_accounts_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_database_accounts_operations.py @@ -42,7 +42,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -51,7 +51,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "location": _SERIALIZER.url("location", location, "str"), } @@ -70,7 +70,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,7 +78,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/restorableDatabaseAccounts" ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -96,7 +96,7 @@ def build_get_by_location_request(location: str, instance_id: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +105,7 @@ def build_get_by_location_request(location: str, instance_id: str, subscription_ "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "location": _SERIALIZER.url("location", location, "str"), "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_databases_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_databases_operations.py index d3c6d3af43ea..b6f535352224 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_databases_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_databases_operations.py @@ -42,7 +42,7 @@ def build_list_request(location: str, instance_id: str, subscription_id: str, ** _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -51,7 +51,7 @@ def build_list_request(location: str, instance_id: str, subscription_id: str, ** "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinDatabases", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "location": _SERIALIZER.url("location", location, "str"), "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_graphs_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_graphs_operations.py index c4eb2026d578..6e9434b18b71 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_graphs_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_graphs_operations.py @@ -51,7 +51,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -60,7 +60,7 @@ def build_list_request( "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGraphs", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "location": _SERIALIZER.url("location", location, "str"), "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_resources_operations.py index 5a6d14031154..c6fd48d2c1b0 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_resources_operations.py @@ -50,7 +50,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +59,7 @@ def build_list_request( "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinResources", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "location": _SERIALIZER.url("location", location, "str"), "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_collections_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_collections_operations.py index 56d3570339c9..eb52372f16d5 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_collections_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_collections_operations.py @@ -51,7 +51,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -60,7 +60,7 @@ def build_list_request( "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbCollections", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "location": _SERIALIZER.url("location", location, "str"), "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_databases_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_databases_operations.py index fd8758e71dd7..b55e7980bc63 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_databases_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_databases_operations.py @@ -42,7 +42,7 @@ def build_list_request(location: str, instance_id: str, subscription_id: str, ** _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -51,7 +51,7 @@ def build_list_request(location: str, instance_id: str, subscription_id: str, ** "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbDatabases", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "location": _SERIALIZER.url("location", location, "str"), "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_resources_operations.py index d63ce3ee58f6..32762ef0d960 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_resources_operations.py @@ -50,7 +50,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +59,7 @@ def build_list_request( "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbResources", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "location": _SERIALIZER.url("location", location, "str"), "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_containers_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_containers_operations.py index 3630399cf3cc..1d8795ec5757 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_containers_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_containers_operations.py @@ -51,7 +51,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -60,7 +60,7 @@ def build_list_request( "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlContainers", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "location": _SERIALIZER.url("location", location, "str"), "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_databases_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_databases_operations.py index 847ce1032796..ac197cf062ff 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_databases_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_databases_operations.py @@ -42,7 +42,7 @@ def build_list_request(location: str, instance_id: str, subscription_id: str, ** _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -51,7 +51,7 @@ def build_list_request(location: str, instance_id: str, subscription_id: str, ** "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlDatabases", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "location": _SERIALIZER.url("location", location, "str"), "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_resources_operations.py index 6434964b4bd8..b6222af353bc 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_resources_operations.py @@ -50,7 +50,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +59,7 @@ def build_list_request( "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlResources", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "location": _SERIALIZER.url("location", location, "str"), "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_table_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_table_resources_operations.py index 1b014900e3c8..85ca41a971a9 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_table_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_table_resources_operations.py @@ -50,7 +50,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +59,7 @@ def build_list_request( "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTableResources", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "location": _SERIALIZER.url("location", location, "str"), "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_tables_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_tables_operations.py index 2a1327a634b6..8a17a34e53f3 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_tables_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_tables_operations.py @@ -50,7 +50,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +59,7 @@ def build_list_request( "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTables", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "location": _SERIALIZER.url("location", location, "str"), "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_service_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_service_operations.py index 3268a28d74ec..288e07a7b17c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_service_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_service_operations.py @@ -47,7 +47,7 @@ def build_list_request(resource_group_name: str, account_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -56,7 +56,7 @@ def build_list_request(resource_group_name: str, account_name: str, subscription "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -82,7 +82,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -92,7 +92,7 @@ def build_create_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -121,7 +121,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -130,7 +130,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -157,7 +157,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +166,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -348,10 +348,17 @@ def _create_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("azure-AsyncOperation") + ) + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_sql_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_sql_resources_operations.py index 8c45119c3e95..712c3579f326 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_sql_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_sql_resources_operations.py @@ -50,7 +50,7 @@ def build_list_sql_databases_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +59,7 @@ def build_list_sql_databases_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -85,7 +85,7 @@ def build_get_sql_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +94,7 @@ def build_get_sql_database_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -121,7 +121,7 @@ def build_create_update_sql_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -131,7 +131,7 @@ def build_create_update_sql_database_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -159,14 +159,14 @@ def build_delete_sql_database_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -190,7 +190,7 @@ def build_get_sql_database_throughput_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -199,7 +199,7 @@ def build_get_sql_database_throughput_request( # pylint: disable=name-too-long "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -226,7 +226,7 @@ def build_update_sql_database_throughput_request( # pylint: disable=name-too-lo _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -236,7 +236,7 @@ def build_update_sql_database_throughput_request( # pylint: disable=name-too-lo "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -265,7 +265,7 @@ def build_migrate_sql_database_to_autoscale_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -274,7 +274,7 @@ def build_migrate_sql_database_to_autoscale_request( # pylint: disable=name-too "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -301,7 +301,7 @@ def build_migrate_sql_database_to_manual_throughput_request( # pylint: disable= _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -310,7 +310,7 @@ def build_migrate_sql_database_to_manual_throughput_request( # pylint: disable= "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -331,136 +331,13 @@ def build_migrate_sql_database_to_manual_throughput_request( # pylint: disable= return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_client_encryption_keys_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, database_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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_client_encryption_key_request( - resource_group_name: str, - account_name: str, - database_name: str, - client_encryption_key_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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "clientEncryptionKeyName": _SERIALIZER.url("client_encryption_key_name", client_encryption_key_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_update_client_encryption_key_request( # pylint: disable=name-too-long - resource_group_name: str, - account_name: str, - database_name: str, - client_encryption_key_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", "2024-12-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "clientEncryptionKeyName": _SERIALIZER.url("client_encryption_key_name", client_encryption_key_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_list_sql_containers_request( resource_group_name: str, account_name: str, database_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", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -469,7 +346,7 @@ def build_list_sql_containers_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -501,7 +378,7 @@ def build_get_sql_container_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -510,7 +387,7 @@ def build_get_sql_container_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -543,7 +420,7 @@ def build_create_update_sql_container_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -553,7 +430,7 @@ def build_create_update_sql_container_request( # pylint: disable=name-too-long "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -587,14 +464,14 @@ def build_delete_sql_container_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -613,90 +490,6 @@ def build_delete_sql_container_request( return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_sql_database_partition_merge_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, database_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", "2024-12-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/partitionMerge", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "databaseName": _SERIALIZER.url("database_name", database_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_list_sql_container_partition_merge_request( # pylint: disable=name-too-long - resource_group_name: str, - account_name: str, - database_name: str, - container_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", "2024-12-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "containerName": _SERIALIZER.url("container_name", container_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - def build_get_sql_container_throughput_request( # pylint: disable=name-too-long resource_group_name: str, account_name: str, @@ -708,7 +501,7 @@ def build_get_sql_container_throughput_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -717,7 +510,7 @@ def build_get_sql_container_throughput_request( # pylint: disable=name-too-long "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -750,7 +543,7 @@ def build_update_sql_container_throughput_request( # pylint: disable=name-too-l _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -760,7 +553,7 @@ def build_update_sql_container_throughput_request( # pylint: disable=name-too-l "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -795,7 +588,7 @@ def build_migrate_sql_container_to_autoscale_request( # pylint: disable=name-to _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -804,7 +597,7 @@ def build_migrate_sql_container_to_autoscale_request( # pylint: disable=name-to "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -837,7 +630,7 @@ def build_migrate_sql_container_to_manual_throughput_request( # pylint: disable _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -846,7 +639,7 @@ def build_migrate_sql_container_to_manual_throughput_request( # pylint: disable "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -868,62 +661,22 @@ def build_migrate_sql_container_to_manual_throughput_request( # pylint: disable return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_sql_database_retrieve_throughput_distribution_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, database_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", "2024-12-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "databaseName": _SERIALIZER.url("database_name", database_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_sql_database_redistribute_throughput_request( # pylint: disable=name-too-long +def build_list_client_encryption_keys_request( # pylint: disable=name-too-long resource_group_name: str, account_name: str, database_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", "2024-12-01-preview")) - 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-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/redistributeThroughput", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -939,35 +692,32 @@ def build_sql_database_redistribute_throughput_request( # pylint: disable=name- _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_sql_container_retrieve_throughput_distribution_request( # pylint: disable=name-too-long +def build_get_client_encryption_key_request( resource_group_name: str, account_name: str, database_name: str, - container_name: str, + client_encryption_key_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", "2024-12-01-preview")) - 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-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -975,7 +725,7 @@ def build_sql_container_retrieve_throughput_distribution_request( # pylint: dis "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" ), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "containerName": _SERIALIZER.url("container_name", container_name, "str"), + "clientEncryptionKeyName": _SERIALIZER.url("client_encryption_key_name", client_encryption_key_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -984,35 +734,33 @@ def build_sql_container_retrieve_throughput_distribution_request( # pylint: dis _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_sql_container_redistribute_throughput_request( # pylint: disable=name-too-long +def build_create_update_client_encryption_key_request( # pylint: disable=name-too-long resource_group_name: str, account_name: str, database_name: str, - container_name: str, + client_encryption_key_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", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1020,7 +768,7 @@ def build_sql_container_redistribute_throughput_request( # pylint: disable=name "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" ), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "containerName": _SERIALIZER.url("container_name", container_name, "str"), + "clientEncryptionKeyName": _SERIALIZER.url("client_encryption_key_name", client_encryption_key_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1033,7 +781,7 @@ def build_sql_container_redistribute_throughput_request( # pylint: disable=name _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) def build_list_sql_stored_procedures_request( @@ -1047,7 +795,7 @@ def build_list_sql_stored_procedures_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1056,7 +804,7 @@ def build_list_sql_stored_procedures_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1090,7 +838,7 @@ def build_get_sql_stored_procedure_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1099,7 +847,7 @@ def build_get_sql_stored_procedure_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1134,7 +882,7 @@ def build_create_update_sql_stored_procedure_request( # pylint: disable=name-to _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -1144,7 +892,7 @@ def build_create_update_sql_stored_procedure_request( # pylint: disable=name-to "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1180,14 +928,14 @@ def build_delete_sql_stored_procedure_request( # pylint: disable=name-too-long ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1218,7 +966,7 @@ def build_list_sql_user_defined_functions_request( # pylint: disable=name-too-l _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1227,7 +975,7 @@ def build_list_sql_user_defined_functions_request( # pylint: disable=name-too-l "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1261,7 +1009,7 @@ def build_get_sql_user_defined_function_request( # pylint: disable=name-too-lon _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1270,7 +1018,7 @@ def build_get_sql_user_defined_function_request( # pylint: disable=name-too-lon "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1305,7 +1053,7 @@ def build_create_update_sql_user_defined_function_request( # pylint: disable=na _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -1315,7 +1063,7 @@ def build_create_update_sql_user_defined_function_request( # pylint: disable=na "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1351,14 +1099,14 @@ def build_delete_sql_user_defined_function_request( # pylint: disable=name-too- ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1389,7 +1137,7 @@ def build_list_sql_triggers_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1398,7 +1146,7 @@ def build_list_sql_triggers_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1432,7 +1180,7 @@ def build_get_sql_trigger_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1441,7 +1189,7 @@ def build_get_sql_trigger_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1476,7 +1224,7 @@ def build_create_update_sql_trigger_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -1486,7 +1234,7 @@ def build_create_update_sql_trigger_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1522,14 +1270,14 @@ def build_delete_sql_trigger_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1555,7 +1303,7 @@ def build_get_sql_role_definition_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1565,7 +1313,7 @@ def build_get_sql_role_definition_request( ) # pylint: disable=line-too-long path_format_arguments = { "roleDefinitionId": _SERIALIZER.url("role_definition_id", role_definition_id, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1591,7 +1339,7 @@ def build_create_update_sql_role_definition_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -1602,7 +1350,7 @@ def build_create_update_sql_role_definition_request( # pylint: disable=name-too ) # pylint: disable=line-too-long path_format_arguments = { "roleDefinitionId": _SERIALIZER.url("role_definition_id", role_definition_id, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1630,7 +1378,7 @@ def build_delete_sql_role_definition_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1640,7 +1388,7 @@ def build_delete_sql_role_definition_request( ) # pylint: disable=line-too-long path_format_arguments = { "roleDefinitionId": _SERIALIZER.url("role_definition_id", role_definition_id, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1666,7 +1414,7 @@ def build_list_sql_role_definitions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1675,7 +1423,7 @@ def build_list_sql_role_definitions_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1701,7 +1449,7 @@ def build_get_sql_role_assignment_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1711,7 +1459,7 @@ def build_get_sql_role_assignment_request( ) # pylint: disable=line-too-long path_format_arguments = { "roleAssignmentId": _SERIALIZER.url("role_assignment_id", role_assignment_id, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1737,7 +1485,7 @@ def build_create_update_sql_role_assignment_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -1748,7 +1496,7 @@ def build_create_update_sql_role_assignment_request( # pylint: disable=name-too ) # pylint: disable=line-too-long path_format_arguments = { "roleAssignmentId": _SERIALIZER.url("role_assignment_id", role_assignment_id, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1776,7 +1524,7 @@ def build_delete_sql_role_assignment_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1786,7 +1534,7 @@ def build_delete_sql_role_assignment_request( ) # pylint: disable=line-too-long path_format_arguments = { "roleAssignmentId": _SERIALIZER.url("role_assignment_id", role_assignment_id, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1812,7 +1560,7 @@ def build_list_sql_role_assignments_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1821,7 +1569,7 @@ def build_list_sql_role_assignments_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1852,7 +1600,7 @@ def build_retrieve_continuous_backup_information_request( # pylint: disable=nam _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -1862,7 +1610,7 @@ def build_retrieve_continuous_backup_information_request( # pylint: disable=nam "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/retrieveContinuousBackupInformation", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -2901,10 +2649,10 @@ def get_long_running_output(pipeline_response): ) @distributed_trace - def list_client_encryption_keys( + def list_sql_containers( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any - ) -> Iterable["_models.ClientEncryptionKeyGetResults"]: - """Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. + ) -> Iterable["_models.SqlContainerGetResults"]: + """Lists the SQL container under an existing Azure Cosmos DB database account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2913,16 +2661,16 @@ def list_client_encryption_keys( :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :return: An iterator like instance of either ClientEncryptionKeyGetResults or the result of + :return: An iterator like instance of either SqlContainerGetResults or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] :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.ClientEncryptionKeysListResult] = kwargs.pop("cls", None) + cls: ClsType[_models.SqlContainerListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2935,7 +2683,7 @@ def list_client_encryption_keys( def prepare_request(next_link=None): if not next_link: - _request = build_list_client_encryption_keys_request( + _request = build_list_sql_containers_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2964,7 +2712,7 @@ def prepare_request(next_link=None): return _request def extract_data(pipeline_response): - deserialized = self._deserialize("ClientEncryptionKeysListResult", pipeline_response) + deserialized = self._deserialize("SqlContainerListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -2988,15 +2736,10 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_client_encryption_key( - self, - resource_group_name: str, - account_name: str, - database_name: str, - client_encryption_key_name: str, - **kwargs: Any - ) -> _models.ClientEncryptionKeyGetResults: - """Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + def get_sql_container( + self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any + ) -> _models.SqlContainerGetResults: + """Gets the SQL container under an existing Azure Cosmos DB database account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3005,10 +2748,10 @@ def get_client_encryption_key( :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. - :type client_encryption_key_name: str - :return: ClientEncryptionKeyGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults + :param container_name: Cosmos DB container name. Required. + :type container_name: str + :return: SqlContainerGetResults or the result of cls(response) + :rtype: ~azure.mgmt.cosmosdb.models.SqlContainerGetResults :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3023,13 +2766,13 @@ def get_client_encryption_key( _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.ClientEncryptionKeyGetResults] = kwargs.pop("cls", None) + cls: ClsType[_models.SqlContainerGetResults] = kwargs.pop("cls", None) - _request = build_get_client_encryption_key_request( + _request = build_get_sql_container_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, - client_encryption_key_name=client_encryption_key_name, + container_name=container_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, @@ -3048,22 +2791,20 @@ def get_client_encryption_key( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("ClientEncryptionKeyGetResults", pipeline_response.http_response) + deserialized = self._deserialize("SqlContainerGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - def _create_update_client_encryption_key_initial( # pylint: disable=name-too-long + def _create_update_sql_container_initial( self, resource_group_name: str, account_name: str, database_name: str, - client_encryption_key_name: str, - create_update_client_encryption_key_parameters: Union[ - _models.ClientEncryptionKeyCreateUpdateParameters, IO[bytes] - ], + container_name: str, + create_update_sql_container_parameters: Union[_models.SqlContainerCreateUpdateParameters, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -3084,18 +2825,16 @@ def _create_update_client_encryption_key_initial( # pylint: disable=name-too-lo content_type = content_type or "application/json" _json = None _content = None - if isinstance(create_update_client_encryption_key_parameters, (IOBase, bytes)): - _content = create_update_client_encryption_key_parameters + if isinstance(create_update_sql_container_parameters, (IOBase, bytes)): + _content = create_update_sql_container_parameters else: - _json = self._serialize.body( - create_update_client_encryption_key_parameters, "ClientEncryptionKeyCreateUpdateParameters" - ) + _json = self._serialize.body(create_update_sql_container_parameters, "SqlContainerCreateUpdateParameters") - _request = build_create_update_client_encryption_key_request( + _request = build_create_update_sql_container_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, - client_encryption_key_name=client_encryption_key_name, + container_name=container_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, @@ -3137,19 +2876,18 @@ def _create_update_client_encryption_key_initial( # pylint: disable=name-too-lo return deserialized # type: ignore @overload - def begin_create_update_client_encryption_key( # pylint: disable=name-too-long + def begin_create_update_sql_container( self, resource_group_name: str, account_name: str, database_name: str, - client_encryption_key_name: str, - create_update_client_encryption_key_parameters: _models.ClientEncryptionKeyCreateUpdateParameters, + container_name: str, + create_update_sql_container_parameters: _models.SqlContainerCreateUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ClientEncryptionKeyGetResults]: - """Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the - Azure Powershell (instead of directly). + ) -> LROPoller[_models.SqlContainerGetResults]: + """Create or update an Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3158,36 +2896,34 @@ def begin_create_update_client_encryption_key( # pylint: disable=name-too-long :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. - :type client_encryption_key_name: str - :param create_update_client_encryption_key_parameters: The parameters to provide for the client - encryption key. Required. - :type create_update_client_encryption_key_parameters: - ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyCreateUpdateParameters + :param container_name: Cosmos DB container name. Required. + :type container_name: str + :param create_update_sql_container_parameters: The parameters to provide for the current SQL + container. Required. + :type create_update_sql_container_parameters: + ~azure.mgmt.cosmosdb.models.SqlContainerCreateUpdateParameters :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 ClientEncryptionKeyGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] + :return: An instance of LROPoller that returns either SqlContainerGetResults or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_update_client_encryption_key( # pylint: disable=name-too-long + def begin_create_update_sql_container( self, resource_group_name: str, account_name: str, database_name: str, - client_encryption_key_name: str, - create_update_client_encryption_key_parameters: IO[bytes], + container_name: str, + create_update_sql_container_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ClientEncryptionKeyGetResults]: - """Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the - Azure Powershell (instead of directly). + ) -> LROPoller[_models.SqlContainerGetResults]: + """Create or update an Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3196,35 +2932,31 @@ def begin_create_update_client_encryption_key( # pylint: disable=name-too-long :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. - :type client_encryption_key_name: str - :param create_update_client_encryption_key_parameters: The parameters to provide for the client - encryption key. Required. - :type create_update_client_encryption_key_parameters: IO[bytes] + :param container_name: Cosmos DB container name. Required. + :type container_name: str + :param create_update_sql_container_parameters: The parameters to provide for the current SQL + container. Required. + :type create_update_sql_container_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns either ClientEncryptionKeyGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] + :return: An instance of LROPoller that returns either SqlContainerGetResults or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_update_client_encryption_key( # pylint: disable=name-too-long + def begin_create_update_sql_container( self, resource_group_name: str, account_name: str, database_name: str, - client_encryption_key_name: str, - create_update_client_encryption_key_parameters: Union[ - _models.ClientEncryptionKeyCreateUpdateParameters, IO[bytes] - ], + container_name: str, + create_update_sql_container_parameters: Union[_models.SqlContainerCreateUpdateParameters, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.ClientEncryptionKeyGetResults]: - """Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the - Azure Powershell (instead of directly). + ) -> LROPoller[_models.SqlContainerGetResults]: + """Create or update an Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3233,17 +2965,15 @@ def begin_create_update_client_encryption_key( # pylint: disable=name-too-long :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. - :type client_encryption_key_name: str - :param create_update_client_encryption_key_parameters: The parameters to provide for the client - encryption key. Is either a ClientEncryptionKeyCreateUpdateParameters type or a IO[bytes] type. - Required. - :type create_update_client_encryption_key_parameters: - ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyCreateUpdateParameters or IO[bytes] - :return: An instance of LROPoller that returns either ClientEncryptionKeyGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] + :param container_name: Cosmos DB container name. Required. + :type container_name: str + :param create_update_sql_container_parameters: The parameters to provide for the current SQL + container. Is either a SqlContainerCreateUpdateParameters type or a IO[bytes] type. Required. + :type create_update_sql_container_parameters: + ~azure.mgmt.cosmosdb.models.SqlContainerCreateUpdateParameters or IO[bytes] + :return: An instance of LROPoller that returns either SqlContainerGetResults or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3251,17 +2981,17 @@ def begin_create_update_client_encryption_key( # pylint: disable=name-too-long 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.ClientEncryptionKeyGetResults] = kwargs.pop("cls", None) + cls: ClsType[_models.SqlContainerGetResults] = 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_update_client_encryption_key_initial( + raw_result = self._create_update_sql_container_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, - client_encryption_key_name=client_encryption_key_name, - create_update_client_encryption_key_parameters=create_update_client_encryption_key_parameters, + container_name=container_name, + create_update_sql_container_parameters=create_update_sql_container_parameters, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -3273,7 +3003,7 @@ def begin_create_update_client_encryption_key( # pylint: disable=name-too-long kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ClientEncryptionKeyGetResults", pipeline_response.http_response) + deserialized = self._deserialize("SqlContainerGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -3285,21 +3015,80 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.ClientEncryptionKeyGetResults].from_continuation_token( + return LROPoller[_models.SqlContainerGetResults].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.ClientEncryptionKeyGetResults]( + return LROPoller[_models.SqlContainerGetResults]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + def _delete_sql_container_initial( + self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_delete_sql_container_request( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + container_name=container_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("azure-AsyncOperation") + ) + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + @distributed_trace - def list_sql_containers( - self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any - ) -> Iterable["_models.SqlContainerGetResults"]: - """Lists the SQL container under an existing Azure Cosmos DB database account. + def begin_delete_sql_container( + self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes an existing Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3308,85 +3097,60 @@ def list_sql_containers( :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :return: An iterator like instance of either SqlContainerGetResults or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] + :param container_name: Cosmos DB container name. Required. + :type container_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlContainerListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_sql_containers_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_sql_container_initial( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + container_name=container_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - def extract_data(pipeline_response): - deserialized = self._deserialize("SqlContainerListResult", pipeline_response) - list_of_elem = deserialized.value + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) + return cls(pipeline_response, None, {}) # type: ignore - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **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, ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def get_sql_container( + def get_sql_container_throughput( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> _models.SqlContainerGetResults: - """Gets the SQL container under an existing Azure Cosmos DB database account. + ) -> _models.ThroughputSettingsGetResults: + """Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database + account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3397,8 +3161,8 @@ def get_sql_container( :type database_name: str :param container_name: Cosmos DB container name. Required. :type container_name: str - :return: SqlContainerGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.SqlContainerGetResults + :return: ThroughputSettingsGetResults or the result of cls(response) + :rtype: ~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3413,9 +3177,9 @@ def get_sql_container( _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.SqlContainerGetResults] = kwargs.pop("cls", None) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) - _request = build_get_sql_container_request( + _request = build_get_sql_container_throughput_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3438,20 +3202,20 @@ def get_sql_container( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("SqlContainerGetResults", pipeline_response.http_response) + deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - def _create_update_sql_container_initial( + def _update_sql_container_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, - create_update_sql_container_parameters: Union[_models.SqlContainerCreateUpdateParameters, IO[bytes]], + update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -3472,12 +3236,12 @@ def _create_update_sql_container_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(create_update_sql_container_parameters, (IOBase, bytes)): - _content = create_update_sql_container_parameters + if isinstance(update_throughput_parameters, (IOBase, bytes)): + _content = update_throughput_parameters else: - _json = self._serialize.body(create_update_sql_container_parameters, "SqlContainerCreateUpdateParameters") + _json = self._serialize.body(update_throughput_parameters, "ThroughputSettingsUpdateParameters") - _request = build_create_update_sql_container_request( + _request = build_update_sql_container_throughput_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3523,18 +3287,18 @@ def _create_update_sql_container_initial( return deserialized # type: ignore @overload - def begin_create_update_sql_container( + def begin_update_sql_container_throughput( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, - create_update_sql_container_parameters: _models.SqlContainerCreateUpdateParameters, + update_throughput_parameters: _models.ThroughputSettingsUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.SqlContainerGetResults]: - """Create or update an Azure Cosmos DB SQL container. + ) -> LROPoller[_models.ThroughputSettingsGetResults]: + """Update RUs per second of an Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3545,32 +3309,32 @@ def begin_create_update_sql_container( :type database_name: str :param container_name: Cosmos DB container name. Required. :type container_name: str - :param create_update_sql_container_parameters: The parameters to provide for the current SQL - container. Required. - :type create_update_sql_container_parameters: - ~azure.mgmt.cosmosdb.models.SqlContainerCreateUpdateParameters + :param update_throughput_parameters: The parameters to provide for the RUs per second of the + current SQL container. Required. + :type update_throughput_parameters: + ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters :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 SqlContainerGetResults or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] + :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the + result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_update_sql_container( + def begin_update_sql_container_throughput( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, - create_update_sql_container_parameters: IO[bytes], + update_throughput_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.SqlContainerGetResults]: - """Create or update an Azure Cosmos DB SQL container. + ) -> LROPoller[_models.ThroughputSettingsGetResults]: + """Update RUs per second of an Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3581,29 +3345,29 @@ def begin_create_update_sql_container( :type database_name: str :param container_name: Cosmos DB container name. Required. :type container_name: str - :param create_update_sql_container_parameters: The parameters to provide for the current SQL - container. Required. - :type create_update_sql_container_parameters: IO[bytes] + :param update_throughput_parameters: The parameters to provide for the RUs per second of the + current SQL container. Required. + :type update_throughput_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns either SqlContainerGetResults or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] + :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the + result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_update_sql_container( + def begin_update_sql_container_throughput( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, - create_update_sql_container_parameters: Union[_models.SqlContainerCreateUpdateParameters, IO[bytes]], + update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.SqlContainerGetResults]: - """Create or update an Azure Cosmos DB SQL container. + ) -> LROPoller[_models.ThroughputSettingsGetResults]: + """Update RUs per second of an Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3614,13 +3378,14 @@ def begin_create_update_sql_container( :type database_name: str :param container_name: Cosmos DB container name. Required. :type container_name: str - :param create_update_sql_container_parameters: The parameters to provide for the current SQL - container. Is either a SqlContainerCreateUpdateParameters type or a IO[bytes] type. Required. - :type create_update_sql_container_parameters: - ~azure.mgmt.cosmosdb.models.SqlContainerCreateUpdateParameters or IO[bytes] - :return: An instance of LROPoller that returns either SqlContainerGetResults or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] + :param update_throughput_parameters: The parameters to provide for the RUs per second of the + current SQL container. Is either a ThroughputSettingsUpdateParameters type or a IO[bytes] type. + Required. + :type update_throughput_parameters: + ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters or IO[bytes] + :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the + result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3628,17 +3393,17 @@ def begin_create_update_sql_container( 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.SqlContainerGetResults] = kwargs.pop("cls", None) + cls: ClsType[_models.ThroughputSettingsGetResults] = 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_update_sql_container_initial( + raw_result = self._update_sql_container_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, container_name=container_name, - create_update_sql_container_parameters=create_update_sql_container_parameters, + update_throughput_parameters=update_throughput_parameters, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -3650,7 +3415,7 @@ def begin_create_update_sql_container( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SqlContainerGetResults", pipeline_response.http_response) + deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -3662,17 +3427,17 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.SqlContainerGetResults].from_continuation_token( + return LROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.SqlContainerGetResults]( + return LROPoller[_models.ThroughputSettingsGetResults]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _delete_sql_container_initial( + def _migrate_sql_container_to_autoscale_initial( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -3689,7 +3454,7 @@ def _delete_sql_container_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_delete_sql_container_request( + _request = build_migrate_sql_container_to_autoscale_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3709,7 +3474,7 @@ def _delete_sql_container_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -3732,10 +3497,10 @@ def _delete_sql_container_initial( return deserialized # type: ignore @distributed_trace - def begin_delete_sql_container( + def begin_migrate_sql_container_to_autoscale( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes an existing Azure Cosmos DB SQL container. + ) -> LROPoller[_models.ThroughputSettingsGetResults]: + """Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3746,20 +3511,21 @@ def begin_delete_sql_container( :type database_name: str :param container_name: Cosmos DB container name. Required. :type container_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] + :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the + result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] :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) + cls: ClsType[_models.ThroughputSettingsGetResults] = 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_sql_container_initial( + raw_result = self._migrate_sql_container_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3773,9 +3539,11 @@ def begin_delete_sql_container( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -3784,21 +3552,18 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller[None].from_continuation_token( + return LROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + return LROPoller[_models.ThroughputSettingsGetResults]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - def _sql_database_partition_merge_initial( - self, - resource_group_name: str, - account_name: str, - database_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], - **kwargs: Any + def _migrate_sql_container_to_manual_throughput_initial( # pylint: disable=name-too-long + self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3808,30 +3573,19 @@ def _sql_database_partition_merge_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) 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)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(merge_parameters, (IOBase, bytes)): - _content = merge_parameters - else: - _json = self._serialize.body(merge_parameters, "MergeParameters") - - _request = build_sql_database_partition_merge_request( + _request = build_migrate_sql_container_to_manual_throughput_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, + container_name=container_name, subscription_id=self._config.subscription_id, api_version=api_version, - content_type=content_type, - json=_json, - content=_content, headers=_headers, params=_params, ) @@ -3867,1518 +3621,11 @@ def _sql_database_partition_merge_initial( return deserialized # type: ignore - @overload - def begin_sql_database_partition_merge( - self, - resource_group_name: str, - account_name: str, - database_name: str, - merge_parameters: _models.MergeParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters - :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 PhysicalPartitionStorageInfoCollection or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_sql_database_partition_merge( - self, - resource_group_name: str, - account_name: str, - database_name: str, - merge_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionStorageInfoCollection or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_sql_database_partition_merge( - self, - resource_group_name: str, - account_name: str, - database_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param merge_parameters: The parameters for the merge operation. Is either a MergeParameters - type or a IO[bytes] type. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters or IO[bytes] - :return: An instance of LROPoller that returns either PhysicalPartitionStorageInfoCollection or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :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.PhysicalPartitionStorageInfoCollection] = 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._sql_database_partition_merge_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - merge_parameters=merge_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionStorageInfoCollection", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, 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.PhysicalPartitionStorageInfoCollection].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.PhysicalPartitionStorageInfoCollection]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _list_sql_container_partition_merge_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(merge_parameters, (IOBase, bytes)): - _content = merge_parameters - else: - _json = self._serialize.body(merge_parameters, "MergeParameters") - - _request = build_list_sql_container_partition_merge_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_list_sql_container_partition_merge( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - merge_parameters: _models.MergeParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a SQL Container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters - :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 PhysicalPartitionStorageInfoCollection or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_list_sql_container_partition_merge( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - merge_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a SQL Container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionStorageInfoCollection or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_list_sql_container_partition_merge( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a SQL Container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param merge_parameters: The parameters for the merge operation. Is either a MergeParameters - type or a IO[bytes] type. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters or IO[bytes] - :return: An instance of LROPoller that returns either PhysicalPartitionStorageInfoCollection or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :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.PhysicalPartitionStorageInfoCollection] = 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_sql_container_partition_merge_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - merge_parameters=merge_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionStorageInfoCollection", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, 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.PhysicalPartitionStorageInfoCollection].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.PhysicalPartitionStorageInfoCollection]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def get_sql_container_throughput( - self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> _models.ThroughputSettingsGetResults: - """Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database - account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :return: ThroughputSettingsGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) - - _request = build_get_sql_container_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _update_sql_container_throughput_initial( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(update_throughput_parameters, (IOBase, bytes)): - _content = update_throughput_parameters - else: - _json = self._serialize.body(update_throughput_parameters, "ThroughputSettingsUpdateParameters") - - _request = build_update_sql_container_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update_sql_container_throughput( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - update_throughput_parameters: _models.ThroughputSettingsUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB SQL container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param update_throughput_parameters: The parameters to provide for the RUs per second of the - current SQL container. Required. - :type update_throughput_parameters: - ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters - :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 ThroughputSettingsGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_sql_container_throughput( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - update_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB SQL container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param update_throughput_parameters: The parameters to provide for the RUs per second of the - current SQL container. Required. - :type update_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_sql_container_throughput( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB SQL container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param update_throughput_parameters: The parameters to provide for the RUs per second of the - current SQL container. Is either a ThroughputSettingsUpdateParameters type or a IO[bytes] type. - Required. - :type update_throughput_parameters: - ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters or IO[bytes] - :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :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.ThroughputSettingsGetResults] = 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_sql_container_throughput_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - update_throughput_parameters=update_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ThroughputSettingsGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _migrate_sql_container_to_autoscale_initial( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_migrate_sql_container_to_autoscale_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_migrate_sql_container_to_autoscale( - self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :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.ThroughputSettingsGetResults] = 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._migrate_sql_container_to_autoscale_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ThroughputSettingsGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _migrate_sql_container_to_manual_throughput_initial( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_migrate_sql_container_to_manual_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_migrate_sql_container_to_manual_throughput( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :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.ThroughputSettingsGetResults] = 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._migrate_sql_container_to_manual_throughput_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ThroughputSettingsGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _sql_database_retrieve_throughput_distribution_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(retrieve_throughput_parameters, (IOBase, bytes)): - _content = retrieve_throughput_parameters - else: - _json = self._serialize.body(retrieve_throughput_parameters, "RetrieveThroughputParameters") - - _request = build_sql_database_retrieve_throughput_distribution_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_sql_database_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: _models.RetrieveThroughputParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current SQL database. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - :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 PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_sql_database_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current SQL database. Required. - :type retrieve_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_sql_database_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current SQL database. Is either a RetrieveThroughputParameters type or a - IO[bytes] type. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - or IO[bytes] - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :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.PhysicalPartitionThroughputInfoResult] = 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._sql_database_retrieve_throughput_distribution_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - retrieve_throughput_parameters=retrieve_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, 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.PhysicalPartitionThroughputInfoResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.PhysicalPartitionThroughputInfoResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _sql_database_redistribute_throughput_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(redistribute_throughput_parameters, (IOBase, bytes)): - _content = redistribute_throughput_parameters - else: - _json = self._serialize.body(redistribute_throughput_parameters, "RedistributeThroughputParameters") - - _request = build_sql_database_redistribute_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_sql_database_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: _models.RedistributeThroughputParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current SQL database. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters - :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 PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_sql_database_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current SQL database. Required. - :type redistribute_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_sql_database_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current SQL database. Is either a RedistributeThroughputParameters type or a - IO[bytes] type. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters or IO[bytes] - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :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.PhysicalPartitionThroughputInfoResult] = 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._sql_database_redistribute_throughput_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - redistribute_throughput_parameters=redistribute_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, 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.PhysicalPartitionThroughputInfoResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.PhysicalPartitionThroughputInfoResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _sql_container_retrieve_throughput_distribution_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(retrieve_throughput_parameters, (IOBase, bytes)): - _content = retrieve_throughput_parameters - else: - _json = self._serialize.body(retrieve_throughput_parameters, "RetrieveThroughputParameters") - - _request = build_sql_container_retrieve_throughput_distribution_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_sql_container_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - retrieve_throughput_parameters: _models.RetrieveThroughputParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB SQL container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current SQL container. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - :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 PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_sql_container_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - retrieve_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB SQL container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current SQL container. Required. - :type retrieve_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_sql_container_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB SQL container. + @distributed_trace + def begin_migrate_sql_container_to_manual_throughput( # pylint: disable=name-too-long + self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any + ) -> LROPoller[_models.ThroughputSettingsGetResults]: + """Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -5389,35 +3636,26 @@ def begin_sql_container_retrieve_throughput_distribution( # pylint: disable=nam :type database_name: str :param container_name: Cosmos DB container name. Required. :type container_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current SQL container. Is either a RetrieveThroughputParameters type or a - IO[bytes] type. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - or IO[bytes] - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] + :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the + result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) 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)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) + cls: ClsType[_models.ThroughputSettingsGetResults] = 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._sql_container_retrieve_throughput_distribution_initial( + raw_result = self._migrate_sql_container_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, container_name=container_name, - retrieve_throughput_parameters=retrieve_throughput_parameters, api_version=api_version, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -5427,37 +3665,192 @@ def begin_sql_container_retrieve_throughput_distribution( # pylint: disable=nam kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) + deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: polling_method = polling if cont_token: - return LROPoller[_models.PhysicalPartitionThroughputInfoResult].from_continuation_token( + return LROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.PhysicalPartitionThroughputInfoResult]( + return LROPoller[_models.ThroughputSettingsGetResults]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _sql_container_redistribute_throughput_initial( # pylint: disable=name-too-long + @distributed_trace + def list_client_encryption_keys( + self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any + ) -> Iterable["_models.ClientEncryptionKeyGetResults"]: + """Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. Required. + :type account_name: str + :param database_name: Cosmos DB database name. Required. + :type database_name: str + :return: An iterator like instance of either ClientEncryptionKeyGetResults or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] + :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.ClientEncryptionKeysListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_client_encryption_keys_request( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ClientEncryptionKeysListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get_client_encryption_key( self, resource_group_name: str, account_name: str, database_name: str, - container_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], + client_encryption_key_name: str, + **kwargs: Any + ) -> _models.ClientEncryptionKeyGetResults: + """Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. Required. + :type account_name: str + :param database_name: Cosmos DB database name. Required. + :type database_name: str + :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. + :type client_encryption_key_name: str + :return: ClientEncryptionKeyGetResults or the result of cls(response) + :rtype: ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ClientEncryptionKeyGetResults] = kwargs.pop("cls", None) + + _request = build_get_client_encryption_key_request( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + client_encryption_key_name=client_encryption_key_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ClientEncryptionKeyGetResults", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_update_client_encryption_key_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + account_name: str, + database_name: str, + client_encryption_key_name: str, + create_update_client_encryption_key_parameters: Union[ + _models.ClientEncryptionKeyCreateUpdateParameters, IO[bytes] + ], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -5478,16 +3871,18 @@ def _sql_container_redistribute_throughput_initial( # pylint: disable=name-too- content_type = content_type or "application/json" _json = None _content = None - if isinstance(redistribute_throughput_parameters, (IOBase, bytes)): - _content = redistribute_throughput_parameters + if isinstance(create_update_client_encryption_key_parameters, (IOBase, bytes)): + _content = create_update_client_encryption_key_parameters else: - _json = self._serialize.body(redistribute_throughput_parameters, "RedistributeThroughputParameters") + _json = self._serialize.body( + create_update_client_encryption_key_parameters, "ClientEncryptionKeyCreateUpdateParameters" + ) - _request = build_sql_container_redistribute_throughput_request( + _request = build_create_update_client_encryption_key_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, - container_name=container_name, + client_encryption_key_name=client_encryption_key_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, @@ -5529,18 +3924,19 @@ def _sql_container_redistribute_throughput_initial( # pylint: disable=name-too- return deserialized # type: ignore @overload - def begin_sql_container_redistribute_throughput( # pylint: disable=name-too-long + def begin_create_update_client_encryption_key( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, database_name: str, - container_name: str, - redistribute_throughput_parameters: _models.RedistributeThroughputParameters, + client_encryption_key_name: str, + create_update_client_encryption_key_parameters: _models.ClientEncryptionKeyCreateUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB SQL container. + ) -> LROPoller[_models.ClientEncryptionKeyGetResults]: + """Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the + Azure Powershell (instead of directly). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -5549,35 +3945,36 @@ def begin_sql_container_redistribute_throughput( # pylint: disable=name-too-lon :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current SQL container. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters + :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. + :type client_encryption_key_name: str + :param create_update_client_encryption_key_parameters: The parameters to provide for the client + encryption key. Required. + :type create_update_client_encryption_key_parameters: + ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyCreateUpdateParameters :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 PhysicalPartitionThroughputInfoResult or - the result of cls(response) + :return: An instance of LROPoller that returns either ClientEncryptionKeyGetResults or the + result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] + ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_sql_container_redistribute_throughput( # pylint: disable=name-too-long + def begin_create_update_client_encryption_key( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, database_name: str, - container_name: str, - redistribute_throughput_parameters: IO[bytes], + client_encryption_key_name: str, + create_update_client_encryption_key_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB SQL container. + ) -> LROPoller[_models.ClientEncryptionKeyGetResults]: + """Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the + Azure Powershell (instead of directly). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -5586,32 +3983,35 @@ def begin_sql_container_redistribute_throughput( # pylint: disable=name-too-lon :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current SQL container. Required. - :type redistribute_throughput_parameters: IO[bytes] + :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. + :type client_encryption_key_name: str + :param create_update_client_encryption_key_parameters: The parameters to provide for the client + encryption key. Required. + :type create_update_client_encryption_key_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) + :return: An instance of LROPoller that returns either ClientEncryptionKeyGetResults or the + result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] + ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_sql_container_redistribute_throughput( # pylint: disable=name-too-long + def begin_create_update_client_encryption_key( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, database_name: str, - container_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], + client_encryption_key_name: str, + create_update_client_encryption_key_parameters: Union[ + _models.ClientEncryptionKeyCreateUpdateParameters, IO[bytes] + ], **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB SQL container. + ) -> LROPoller[_models.ClientEncryptionKeyGetResults]: + """Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the + Azure Powershell (instead of directly). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -5620,17 +4020,17 @@ def begin_sql_container_redistribute_throughput( # pylint: disable=name-too-lon :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current SQL container. Is either a RedistributeThroughputParameters type or - a IO[bytes] type. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters or IO[bytes] - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) + :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. + :type client_encryption_key_name: str + :param create_update_client_encryption_key_parameters: The parameters to provide for the client + encryption key. Is either a ClientEncryptionKeyCreateUpdateParameters type or a IO[bytes] type. + Required. + :type create_update_client_encryption_key_parameters: + ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyCreateUpdateParameters or IO[bytes] + :return: An instance of LROPoller that returns either ClientEncryptionKeyGetResults or the + result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] + ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -5638,17 +4038,17 @@ def begin_sql_container_redistribute_throughput( # pylint: disable=name-too-lon 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.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) + cls: ClsType[_models.ClientEncryptionKeyGetResults] = 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._sql_container_redistribute_throughput_initial( + raw_result = self._create_update_client_encryption_key_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, - container_name=container_name, - redistribute_throughput_parameters=redistribute_throughput_parameters, + client_encryption_key_name=client_encryption_key_name, + create_update_client_encryption_key_parameters=create_update_client_encryption_key_parameters, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -5660,27 +4060,25 @@ def begin_sql_container_redistribute_throughput( # pylint: disable=name-too-lon kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) + deserialized = self._deserialize("ClientEncryptionKeyGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: polling_method = polling if cont_token: - return LROPoller[_models.PhysicalPartitionThroughputInfoResult].from_continuation_token( + return LROPoller[_models.ClientEncryptionKeyGetResults].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.PhysicalPartitionThroughputInfoResult]( + return LROPoller[_models.ClientEncryptionKeyGetResults]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_table_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_table_resources_operations.py index ce89a5759846..80f7c685440f 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_table_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_table_resources_operations.py @@ -50,7 +50,7 @@ def build_list_tables_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +59,7 @@ def build_list_tables_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -85,7 +85,7 @@ def build_get_table_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +94,7 @@ def build_get_table_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -121,7 +121,7 @@ def build_create_update_table_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -131,7 +131,7 @@ def build_create_update_table_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -159,14 +159,14 @@ def build_delete_table_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -190,7 +190,7 @@ def build_get_table_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -199,7 +199,7 @@ def build_get_table_throughput_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -226,7 +226,7 @@ def build_update_table_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -236,7 +236,7 @@ def build_update_table_throughput_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -265,7 +265,7 @@ def build_migrate_table_to_autoscale_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -274,7 +274,7 @@ def build_migrate_table_to_autoscale_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -301,7 +301,7 @@ def build_migrate_table_to_manual_throughput_request( # pylint: disable=name-to _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -310,7 +310,7 @@ def build_migrate_table_to_manual_throughput_request( # pylint: disable=name-to "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -337,7 +337,7 @@ def build_retrieve_continuous_backup_information_request( # pylint: disable=nam _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-04-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -347,7 +347,7 @@ def build_retrieve_continuous_backup_information_request( # pylint: disable=nam "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/retrieveContinuousBackupInformation", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -370,299 +370,7 @@ def build_retrieve_continuous_backup_information_request( # pylint: disable=nam return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_table_role_definition_request( - resource_group_name: str, account_name: str, role_definition_id: 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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId}", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "roleDefinitionId": _SERIALIZER.url("role_definition_id", role_definition_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_update_table_role_definition_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, role_definition_id: 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", "2024-12-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId}", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "roleDefinitionId": _SERIALIZER.url("role_definition_id", role_definition_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_table_role_definition_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, role_definition_id: 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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId}", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "roleDefinitionId": _SERIALIZER.url("role_definition_id", role_definition_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_table_role_definitions_request( # pylint: disable=name-too-long - resource_group_name: str, account_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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - } - - _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_table_role_assignment_request( - resource_group_name: str, account_name: str, role_assignment_id: 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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId}", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "roleAssignmentId": _SERIALIZER.url("role_assignment_id", role_assignment_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_update_table_role_assignment_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, role_assignment_id: 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", "2024-12-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId}", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "roleAssignmentId": _SERIALIZER.url("role_assignment_id", role_assignment_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_table_role_assignment_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, role_assignment_id: 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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId}", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "roleAssignmentId": _SERIALIZER.url("role_assignment_id", role_assignment_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_table_role_assignments_request( # pylint: disable=name-too-long - resource_group_name: str, account_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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments", - ) # 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 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - } - - _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 TableResourcesOperations: # pylint: disable=too-many-public-methods +class TableResourcesOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -1878,965 +1586,3 @@ def get_long_running_output(pipeline_response): return LROPoller[_models.BackupInformation]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - - @distributed_trace - def get_table_role_definition( - self, resource_group_name: str, account_name: str, role_definition_id: str, **kwargs: Any - ) -> _models.TableRoleDefinitionResource: - """Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given - Id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param role_definition_id: The GUID for the Role Definition. Required. - :type role_definition_id: str - :return: TableRoleDefinitionResource or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.TableRoleDefinitionResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.TableRoleDefinitionResource] = kwargs.pop("cls", None) - - _request = build_get_table_role_definition_request( - resource_group_name=resource_group_name, - account_name=account_name, - role_definition_id=role_definition_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("TableRoleDefinitionResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_update_table_role_definition_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - role_definition_id: str, - create_update_table_role_definition_parameters: Union[_models.TableRoleDefinitionResource, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(create_update_table_role_definition_parameters, (IOBase, bytes)): - _content = create_update_table_role_definition_parameters - else: - _json = self._serialize.body(create_update_table_role_definition_parameters, "TableRoleDefinitionResource") - - _request = build_create_update_table_role_definition_request( - resource_group_name=resource_group_name, - account_name=account_name, - role_definition_id=role_definition_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - 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["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_update_table_role_definition( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - role_definition_id: str, - create_update_table_role_definition_parameters: _models.TableRoleDefinitionResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.TableRoleDefinitionResource]: - """Creates or updates an Azure Cosmos DB Table Role Definition. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param role_definition_id: The GUID for the Role Definition. Required. - :type role_definition_id: str - :param create_update_table_role_definition_parameters: The properties required to create or - update a Role Definition. Required. - :type create_update_table_role_definition_parameters: - ~azure.mgmt.cosmosdb.models.TableRoleDefinitionResource - :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 TableRoleDefinitionResource or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.TableRoleDefinitionResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_update_table_role_definition( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - role_definition_id: str, - create_update_table_role_definition_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.TableRoleDefinitionResource]: - """Creates or updates an Azure Cosmos DB Table Role Definition. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param role_definition_id: The GUID for the Role Definition. Required. - :type role_definition_id: str - :param create_update_table_role_definition_parameters: The properties required to create or - update a Role Definition. Required. - :type create_update_table_role_definition_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either TableRoleDefinitionResource or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.TableRoleDefinitionResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_update_table_role_definition( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - role_definition_id: str, - create_update_table_role_definition_parameters: Union[_models.TableRoleDefinitionResource, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.TableRoleDefinitionResource]: - """Creates or updates an Azure Cosmos DB Table Role Definition. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param role_definition_id: The GUID for the Role Definition. Required. - :type role_definition_id: str - :param create_update_table_role_definition_parameters: The properties required to create or - update a Role Definition. Is either a TableRoleDefinitionResource type or a IO[bytes] type. - Required. - :type create_update_table_role_definition_parameters: - ~azure.mgmt.cosmosdb.models.TableRoleDefinitionResource or IO[bytes] - :return: An instance of LROPoller that returns either TableRoleDefinitionResource or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.TableRoleDefinitionResource] - :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.TableRoleDefinitionResource] = 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_update_table_role_definition_initial( - resource_group_name=resource_group_name, - account_name=account_name, - role_definition_id=role_definition_id, - create_update_table_role_definition_parameters=create_update_table_role_definition_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("TableRoleDefinitionResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.TableRoleDefinitionResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.TableRoleDefinitionResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_table_role_definition_initial( - self, resource_group_name: str, account_name: str, role_definition_id: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_table_role_definition_request( - resource_group_name=resource_group_name, - account_name=account_name, - role_definition_id=role_definition_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete_table_role_definition( - self, resource_group_name: str, account_name: str, role_definition_id: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes an existing Azure Cosmos DB Table Role Definition. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param role_definition_id: The GUID for the Role Definition. Required. - :type role_definition_id: 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_table_role_definition_initial( - resource_group_name=resource_group_name, - account_name=account_name, - role_definition_id=role_definition_id, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_table_role_definitions( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> Iterable["_models.TableRoleDefinitionResource"]: - """Retrieves the list of all Azure Cosmos DB Table Role Definitions. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :return: An iterator like instance of either TableRoleDefinitionResource or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.TableRoleDefinitionResource] - :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.TableRoleDefinitionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_table_role_definitions_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("TableRoleDefinitionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - 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_table_role_assignment( - self, resource_group_name: str, account_name: str, role_assignment_id: str, **kwargs: Any - ) -> _models.TableRoleAssignmentResource: - """Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given - Id. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param role_assignment_id: The GUID for the Role Assignment. Required. - :type role_assignment_id: str - :return: TableRoleAssignmentResource or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.TableRoleAssignmentResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.TableRoleAssignmentResource] = kwargs.pop("cls", None) - - _request = build_get_table_role_assignment_request( - resource_group_name=resource_group_name, - account_name=account_name, - role_assignment_id=role_assignment_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("TableRoleAssignmentResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_update_table_role_assignment_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - role_assignment_id: str, - create_update_table_role_assignment_parameters: Union[_models.TableRoleAssignmentResource, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(create_update_table_role_assignment_parameters, (IOBase, bytes)): - _content = create_update_table_role_assignment_parameters - else: - _json = self._serialize.body(create_update_table_role_assignment_parameters, "TableRoleAssignmentResource") - - _request = build_create_update_table_role_assignment_request( - resource_group_name=resource_group_name, - account_name=account_name, - role_assignment_id=role_assignment_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - 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["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_update_table_role_assignment( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - role_assignment_id: str, - create_update_table_role_assignment_parameters: _models.TableRoleAssignmentResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.TableRoleAssignmentResource]: - """Creates or updates an Azure Cosmos DB Table Role Assignment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param role_assignment_id: The GUID for the Role Assignment. Required. - :type role_assignment_id: str - :param create_update_table_role_assignment_parameters: The properties required to create or - update a Role Assignment. Required. - :type create_update_table_role_assignment_parameters: - ~azure.mgmt.cosmosdb.models.TableRoleAssignmentResource - :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 TableRoleAssignmentResource or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.TableRoleAssignmentResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_update_table_role_assignment( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - role_assignment_id: str, - create_update_table_role_assignment_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.TableRoleAssignmentResource]: - """Creates or updates an Azure Cosmos DB Table Role Assignment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param role_assignment_id: The GUID for the Role Assignment. Required. - :type role_assignment_id: str - :param create_update_table_role_assignment_parameters: The properties required to create or - update a Role Assignment. Required. - :type create_update_table_role_assignment_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either TableRoleAssignmentResource or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.TableRoleAssignmentResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_update_table_role_assignment( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - role_assignment_id: str, - create_update_table_role_assignment_parameters: Union[_models.TableRoleAssignmentResource, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.TableRoleAssignmentResource]: - """Creates or updates an Azure Cosmos DB Table Role Assignment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param role_assignment_id: The GUID for the Role Assignment. Required. - :type role_assignment_id: str - :param create_update_table_role_assignment_parameters: The properties required to create or - update a Role Assignment. Is either a TableRoleAssignmentResource type or a IO[bytes] type. - Required. - :type create_update_table_role_assignment_parameters: - ~azure.mgmt.cosmosdb.models.TableRoleAssignmentResource or IO[bytes] - :return: An instance of LROPoller that returns either TableRoleAssignmentResource or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.TableRoleAssignmentResource] - :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.TableRoleAssignmentResource] = 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_update_table_role_assignment_initial( - resource_group_name=resource_group_name, - account_name=account_name, - role_assignment_id=role_assignment_id, - create_update_table_role_assignment_parameters=create_update_table_role_assignment_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("TableRoleAssignmentResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.TableRoleAssignmentResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.TableRoleAssignmentResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_table_role_assignment_initial( - self, resource_group_name: str, account_name: str, role_assignment_id: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_table_role_assignment_request( - resource_group_name=resource_group_name, - account_name=account_name, - role_assignment_id=role_assignment_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete_table_role_assignment( - self, resource_group_name: str, account_name: str, role_assignment_id: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes an existing Azure Cosmos DB Table Role Assignment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param role_assignment_id: The GUID for the Role Assignment. Required. - :type role_assignment_id: 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_table_role_assignment_initial( - resource_group_name=resource_group_name, - account_name=account_name, - role_assignment_id=role_assignment_id, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_table_role_assignments( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> Iterable["_models.TableRoleAssignmentResource"]: - """Retrieves the list of all Azure Cosmos DB Table Role Assignments. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :return: An iterator like instance of either TableRoleAssignmentResource or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.TableRoleAssignmentResource] - :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.TableRoleAssignmentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_table_role_assignments_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("TableRoleAssignmentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pool_account_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pool_account_operations.py deleted file mode 100644 index 6488036f4c95..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pool_account_operations.py +++ /dev/null @@ -1,616 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_request( - resource_group_name: str, - throughput_pool_name: str, - throughput_pool_account_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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName}", - ) # 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 - ), - "throughputPoolName": _SERIALIZER.url( - "throughput_pool_name", - throughput_pool_name, - "str", - max_length=50, - min_length=3, - pattern=r"^[a-z0-9]+(-[a-z0-9]+)*", - ), - "throughputPoolAccountName": _SERIALIZER.url( - "throughput_pool_account_name", - throughput_pool_account_name, - "str", - max_length=50, - min_length=3, - pattern=r"^[a-z0-9]+(-[a-z0-9]+)*", - ), - } - - _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_request( - resource_group_name: str, - throughput_pool_name: str, - throughput_pool_account_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", "2024-12-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName}", - ) # 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 - ), - "throughputPoolName": _SERIALIZER.url( - "throughput_pool_name", - throughput_pool_name, - "str", - max_length=50, - min_length=3, - pattern=r"^[a-z0-9]+(-[a-z0-9]+)*", - ), - "throughputPoolAccountName": _SERIALIZER.url( - "throughput_pool_account_name", - throughput_pool_account_name, - "str", - max_length=50, - min_length=3, - pattern=r"^[a-z0-9]+(-[a-z0-9]+)*", - ), - } - - _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, - throughput_pool_name: str, - throughput_pool_account_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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName}", - ) # 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 - ), - "throughputPoolName": _SERIALIZER.url( - "throughput_pool_name", - throughput_pool_name, - "str", - max_length=50, - min_length=3, - pattern=r"^[a-z0-9]+(-[a-z0-9]+)*", - ), - "throughputPoolAccountName": _SERIALIZER.url( - "throughput_pool_account_name", - throughput_pool_account_name, - "str", - max_length=50, - min_length=3, - pattern=r"^[a-z0-9]+(-[a-z0-9]+)*", - ), - } - - _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 ThroughputPoolAccountOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.CosmosDBManagementClient`'s - :attr:`throughput_pool_account` 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 get( - self, resource_group_name: str, throughput_pool_name: str, throughput_pool_account_name: str, **kwargs: Any - ) -> _models.ThroughputPoolAccountResource: - """Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param throughput_pool_account_name: Cosmos DB global database account in a Throughput Pool. - Required. - :type throughput_pool_account_name: str - :return: ThroughputPoolAccountResource or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputPoolAccountResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - throughput_pool_account_name=throughput_pool_account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ThroughputPoolAccountResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_initial( - self, - resource_group_name: str, - throughput_pool_name: str, - throughput_pool_account_name: str, - body: Union[_models.ThroughputPoolAccountResource, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "ThroughputPoolAccountResource") - - _request = build_create_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - throughput_pool_account_name=throughput_pool_account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create( - self, - resource_group_name: str, - throughput_pool_name: str, - throughput_pool_account_name: str, - body: _models.ThroughputPoolAccountResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ThroughputPoolAccountResource]: - """Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred - when performing updates on an account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param throughput_pool_account_name: Cosmos DB global database account in a Throughput Pool. - Required. - :type throughput_pool_account_name: str - :param body: The parameters to provide for the current ThroughputPoolAccount. Required. - :type body: ~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource - :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 ThroughputPoolAccountResource or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - throughput_pool_name: str, - throughput_pool_account_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ThroughputPoolAccountResource]: - """Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred - when performing updates on an account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param throughput_pool_account_name: Cosmos DB global database account in a Throughput Pool. - Required. - :type throughput_pool_account_name: str - :param body: The parameters to provide for the current ThroughputPoolAccount. 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 ThroughputPoolAccountResource or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - throughput_pool_name: str, - throughput_pool_account_name: str, - body: Union[_models.ThroughputPoolAccountResource, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ThroughputPoolAccountResource]: - """Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred - when performing updates on an account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param throughput_pool_account_name: Cosmos DB global database account in a Throughput Pool. - Required. - :type throughput_pool_account_name: str - :param body: The parameters to provide for the current ThroughputPoolAccount. Is either a - ThroughputPoolAccountResource type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource or IO[bytes] - :return: An instance of LROPoller that returns either ThroughputPoolAccountResource or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource] - :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.ThroughputPoolAccountResource] = 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, - throughput_pool_name=throughput_pool_name, - throughput_pool_account_name=throughput_pool_account_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputPoolAccountResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, 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.ThroughputPoolAccountResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ThroughputPoolAccountResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, throughput_pool_name: str, throughput_pool_account_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - throughput_pool_account_name=throughput_pool_account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - 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["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - 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, throughput_pool_name: str, throughput_pool_account_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Removes an existing Azure Cosmos DB database account from a throughput pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param throughput_pool_account_name: Cosmos DB global database account in a Throughput Pool. - Required. - :type throughput_pool_account_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._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( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - throughput_pool_account_name=throughput_pool_account_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pool_accounts_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pool_accounts_operations.py deleted file mode 100644 index f2c1849d39ce..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pool_accounts_operations.py +++ /dev/null @@ -1,183 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - resource_group_name: str, throughput_pool_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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts", - ) # 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 - ), - "throughputPoolName": _SERIALIZER.url( - "throughput_pool_name", - throughput_pool_name, - "str", - max_length=50, - min_length=3, - pattern=r"^[a-z0-9]+(-[a-z0-9]+)*", - ), - } - - _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 ThroughputPoolAccountsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.CosmosDBManagementClient`'s - :attr:`throughput_pool_accounts` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, throughput_pool_name: str, **kwargs: Any - ) -> Iterable["_models.ThroughputPoolAccountResource"]: - """Lists all the Azure Cosmos DB accounts available under the subscription. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :return: An iterator like instance of either ThroughputPoolAccountResource or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource] - :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.ThroughputPoolAccountsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ThroughputPoolAccountsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pool_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pool_operations.py deleted file mode 100644 index 2919a1dba435..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pool_operations.py +++ /dev/null @@ -1,795 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_request( - resource_group_name: str, throughput_pool_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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}", - ) # 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 - ), - "throughputPoolName": _SERIALIZER.url( - "throughput_pool_name", - throughput_pool_name, - "str", - max_length=50, - min_length=3, - pattern=r"^[a-z0-9]+(-[a-z0-9]+)*", - ), - } - - _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, throughput_pool_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", "2024-12-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}", - ) # 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 - ), - "throughputPoolName": _SERIALIZER.url( - "throughput_pool_name", - throughput_pool_name, - "str", - max_length=50, - min_length=3, - pattern=r"^[a-z0-9]+(-[a-z0-9]+)*", - ), - } - - _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, throughput_pool_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", "2024-12-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}", - ) # 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 - ), - "throughputPoolName": _SERIALIZER.url( - "throughput_pool_name", - throughput_pool_name, - "str", - max_length=50, - min_length=3, - pattern=r"^[a-z0-9]+(-[a-z0-9]+)*", - ), - } - - _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, throughput_pool_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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}", - ) # 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 - ), - "throughputPoolName": _SERIALIZER.url( - "throughput_pool_name", - throughput_pool_name, - "str", - max_length=50, - min_length=3, - pattern=r"^[a-z0-9]+(-[a-z0-9]+)*", - ), - } - - _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 ThroughputPoolOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.CosmosDBManagementClient`'s - :attr:`throughput_pool` 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 get(self, resource_group_name: str, throughput_pool_name: str, **kwargs: Any) -> _models.ThroughputPoolResource: - """Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :return: ThroughputPoolResource or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.ThroughputPoolResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputPoolResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ThroughputPoolResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - throughput_pool_name: str, - body: Union[_models.ThroughputPoolResource, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "ThroughputPoolResource") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - throughput_pool_name: str, - body: _models.ThroughputPoolResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ThroughputPoolResource]: - """Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred - when performing updates on an account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param body: The parameters to provide for the current ThroughputPool. Required. - :type body: ~azure.mgmt.cosmosdb.models.ThroughputPoolResource - :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 ThroughputPoolResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - throughput_pool_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ThroughputPoolResource]: - """Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred - when performing updates on an account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param body: The parameters to provide for the current ThroughputPool. 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 ThroughputPoolResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - throughput_pool_name: str, - body: Union[_models.ThroughputPoolResource, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ThroughputPoolResource]: - """Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred - when performing updates on an account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param body: The parameters to provide for the current ThroughputPool. Is either a - ThroughputPoolResource type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.cosmosdb.models.ThroughputPoolResource or IO[bytes] - :return: An instance of LROPoller that returns either ThroughputPoolResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :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.ThroughputPoolResource] = 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, - throughput_pool_name=throughput_pool_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputPoolResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, 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.ThroughputPoolResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ThroughputPoolResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - throughput_pool_name: str, - body: Optional[Union[_models.ThroughputPoolUpdate, IO[bytes]]] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _json = self._serialize.body(body, "ThroughputPoolUpdate") - else: - _json = None - - _request = build_update_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - 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["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - throughput_pool_name: str, - body: Optional[_models.ThroughputPoolUpdate] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ThroughputPoolResource]: - """Updates the properties of an existing Azure Cosmos DB Throughput Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param body: The parameters to provide for the current Throughput Pool. Default value is None. - :type body: ~azure.mgmt.cosmosdb.models.ThroughputPoolUpdate - :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 ThroughputPoolResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - throughput_pool_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ThroughputPoolResource]: - """Updates the properties of an existing Azure Cosmos DB Throughput Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param body: The parameters to provide for the current Throughput Pool. Default value is None. - :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 ThroughputPoolResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - throughput_pool_name: str, - body: Optional[Union[_models.ThroughputPoolUpdate, IO[bytes]]] = None, - **kwargs: Any - ) -> LROPoller[_models.ThroughputPoolResource]: - """Updates the properties of an existing Azure Cosmos DB Throughput Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param body: The parameters to provide for the current Throughput Pool. Is either a - ThroughputPoolUpdate type or a IO[bytes] type. Default value is None. - :type body: ~azure.mgmt.cosmosdb.models.ThroughputPoolUpdate or IO[bytes] - :return: An instance of LROPoller that returns either ThroughputPoolResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :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.ThroughputPoolResource] = 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, - throughput_pool_name=throughput_pool_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputPoolResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, 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.ThroughputPoolResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ThroughputPoolResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial(self, resource_group_name: str, throughput_pool_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - 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["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - 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, throughput_pool_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes an existing Azure Cosmos DB Throughput Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._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( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pools_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pools_operations.py deleted file mode 100644 index 63aa00ea6f78..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pools_operations.py +++ /dev/null @@ -1,270 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/throughputPools") - 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", "2024-12-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools", - ) # 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) - - -class ThroughputPoolsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.CosmosDBManagementClient`'s - :attr:`throughput_pools` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models.ThroughputPoolResource"]: - """Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - - :return: An iterator like instance of either ThroughputPoolResource or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :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.ThroughputPoolsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ThroughputPoolsListResult", 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.ThroughputPoolResource"]: - """List all the ThroughputPools in a given 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 ThroughputPoolResource or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :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.ThroughputPoolsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ThroughputPoolsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/chaos_fault_enable_disable.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/chaos_fault_enable_disable.py deleted file mode 100644 index 4b9ad5f3c2a5..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/chaos_fault_enable_disable.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python chaos_fault_enable_disable.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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.chaos_fault.begin_enable_disable( - resource_group_name="myResourceGroupName", - account_name="myAccountName", - chaos_fault="ServiceUnavailability", - chaos_fault_request={ - "properties": { - "action": "Enable", - "containerName": "testCollection", - "databaseName": "testDatabase", - "region": "EastUS", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/ChaosFaultEnableDisable.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/chaos_fault_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/chaos_fault_get.py deleted file mode 100644 index b2ba3c278234..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/chaos_fault_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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python chaos_fault_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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.chaos_fault.get( - resource_group_name="rg1", - account_name="ddb1", - chaos_fault="ServiceUnavailability", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/ChaosFaultGet.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/chaos_fault_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/chaos_fault_list.py deleted file mode 100644 index 09e9cd493241..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/chaos_fault_list.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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python chaos_fault_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.chaos_fault.list( - resource_group_name="rg1", - account_name="ddb1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/ChaosFaultList.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_create_update.py index e7f63c53d3dd..81e3be6f7a58 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_create_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraKeyspaceCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_delete.py index f7b641215cf1..6599da59d274 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraKeyspaceDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_get.py index ae19ae4319f8..34105c938b9b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraKeyspaceGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_list.py index 282720bfdc52..142236c4ad7d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraKeyspaceList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_migrate_to_autoscale.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_migrate_to_autoscale.py index a3302bca5a20..045aa9472f6f 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_migrate_to_autoscale.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_migrate_to_autoscale.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_migrate_to_manual_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_migrate_to_manual_throughput.py index 6ab188e0af38..2c97d58a6b94 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_migrate_to_manual_throughput.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_migrate_to_manual_throughput.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_throughput_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_throughput_get.py index ef0191a0ebeb..2fea4f6b9f67 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_throughput_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_throughput_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraKeyspaceThroughputGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_throughput_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_throughput_update.py index e5259bf1cc5e..89c637c321ce 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_throughput_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_throughput_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_create_update.py index 2940fb5b2f28..b672343217d0 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_create_update.py @@ -40,7 +40,6 @@ def main(): "properties": { "options": {}, "resource": { - "analyticalStorageTtl": 500, "defaultTtl": 100, "id": "tableName", "schema": { @@ -56,6 +55,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraTableCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_delete.py index 41b41fcdcc8b..05eaef39c4b1 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraTableDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_get.py index a0050dd5ef20..49302cdabe73 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraTableGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_list.py index de494ddab4c7..e60e19d58073 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraTableList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_migrate_to_autoscale.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_migrate_to_autoscale.py index ccd477a80252..18ad1fcd8429 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_migrate_to_autoscale.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_migrate_to_autoscale.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraTableMigrateToAutoscale.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_migrate_to_manual_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_migrate_to_manual_throughput.py index 7b9e1e8f7c1f..2205607b06f6 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_migrate_to_manual_throughput.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_migrate_to_manual_throughput.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraTableMigrateToManualThroughput.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_throughput_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_throughput_get.py index 5799318a611b..8116e171b5c3 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_throughput_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_throughput_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraTableThroughputGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_throughput_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_throughput_update.py index 65b194fe226b..205e939c9e0b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_throughput_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_throughput_update.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraTableThroughputUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_create_update.py deleted file mode 100644 index d87478e65373..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_create_update.py +++ /dev/null @@ -1,54 +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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_cassandra_view_create_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.cassandra_resources.begin_create_update_cassandra_view( - resource_group_name="rg1", - account_name="ddb1", - keyspace_name="keyspacename", - view_name="viewname", - create_update_cassandra_view_parameters={ - "properties": { - "options": {}, - "resource": { - "id": "viewname", - "viewDefinition": "SELECT columna, columnb, columnc FROM keyspacename.srctablename WHERE columna IS NOT NULL AND columnc IS NOT NULL PRIMARY (columnc, columna)", - }, - }, - "tags": {}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewCreateUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_delete.py deleted file mode 100644 index 6935bcd52d09..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_delete.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_cassandra_view_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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - client.cassandra_resources.begin_delete_cassandra_view( - resource_group_name="rg1", - account_name="ddb1", - keyspace_name="keyspacename", - view_name="viewname", - ).result() - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_get.py deleted file mode 100644 index ca1686c205c3..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_get.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_cassandra_view_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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.cassandra_resources.get_cassandra_view( - resource_group_name="rg1", - account_name="ddb1", - keyspace_name="keyspacename", - view_name="viewname", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewGet.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_list.py deleted file mode 100644 index ddc37e59875a..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_list.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_cassandra_view_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.cassandra_resources.list_cassandra_views( - resource_group_name="rgName", - account_name="ddb1", - keyspace_name="keyspacename", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewList.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_migrate_to_autoscale.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_migrate_to_autoscale.py deleted file mode 100644 index e3c87ad9db2e..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_migrate_to_autoscale.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_cassandra_view_migrate_to_autoscale.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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.cassandra_resources.begin_migrate_cassandra_view_to_autoscale( - resource_group_name="rg1", - account_name="ddb1", - keyspace_name="keyspacename", - view_name="viewname", - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewMigrateToAutoscale.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_migrate_to_manual_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_migrate_to_manual_throughput.py deleted file mode 100644 index b484f8223aa7..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_migrate_to_manual_throughput.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_cassandra_view_migrate_to_manual_throughput.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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.cassandra_resources.begin_migrate_cassandra_view_to_manual_throughput( - resource_group_name="rg1", - account_name="ddb1", - keyspace_name="keyspacename", - view_name="viewname", - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewMigrateToManualThroughput.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_throughput_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_throughput_get.py deleted file mode 100644 index cb7df494a3e1..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_throughput_get.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_cassandra_view_throughput_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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.cassandra_resources.get_cassandra_view_throughput( - resource_group_name="rg1", - account_name="ddb1", - keyspace_name="keyspacename", - view_name="viewname", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewThroughputGet.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_throughput_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_throughput_update.py deleted file mode 100644 index fe77f93fc2a6..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_throughput_update.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_cassandra_view_throughput_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.cassandra_resources.begin_update_cassandra_view_throughput( - resource_group_name="rg1", - account_name="ddb1", - keyspace_name="keyspacename", - view_name="viewname", - update_throughput_parameters={"properties": {"resource": {"throughput": 400}}, "tags": {}}, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewThroughputUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_get_metric_definitions.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_get_metric_definitions.py index 1341b54214dc..39035c4b227b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_get_metric_definitions.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_get_metric_definitions.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionGetMetricDefinitions.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCollectionGetMetricDefinitions.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_get_metrics.py index b2e5c7a5f168..d39797aac3ef 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_get_metrics.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_get_metrics.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCollectionGetMetrics.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_get_usages.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_get_usages.py index 7cd48a511f37..6436335656fa 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_get_usages.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_get_usages.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionGetUsages.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCollectionGetUsages.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_get_metrics.py index 18c950fe6957..d979ad3e13f7 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_get_metrics.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_get_metrics.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionPartitionGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCollectionPartitionGetMetrics.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_get_usages.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_get_usages.py index 9cd2cd422d5e..dda10fe1a5ad 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_get_usages.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_get_usages.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionPartitionGetUsages.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCollectionPartitionGetUsages.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_region_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_region_get_metrics.py index eb545d5f91aa..baecbfff1855 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_region_get_metrics.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_region_get_metrics.py @@ -42,6 +42,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionPartitionRegionGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCollectionPartitionRegionGetMetrics.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_create.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_create.py index daef66e6d2da..a2e9fd586a9b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_create.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_create.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceCreate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDataTransferServiceCreate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_delete.py index 00bb3b67dc53..cae5b2af07f9 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDataTransferServiceDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_get.py index f7fbf41ef6bc..3b3d90035f85 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDataTransferServiceGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_check_name_exists.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_check_name_exists.py index 81508266e0a5..104744d37cba 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_check_name_exists.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_check_name_exists.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountCheckNameExists.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountCheckNameExists.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_create_max.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_create_max.py index d635c8926d87..3077185cacba 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_create_max.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_create_max.py @@ -54,7 +54,6 @@ def main(): "type": "Periodic", }, "capacity": {"totalThroughputLimit": 2000}, - "capacityMode": "Provisioned", "consistencyPolicy": { "defaultConsistencyLevel": "BoundedStaleness", "maxIntervalInSeconds": 10, @@ -64,13 +63,10 @@ def main(): "createMode": "Default", "databaseAccountOfferType": "Standard", "defaultIdentity": "FirstPartyIdentity", - "defaultPriorityLevel": "Low", "enableAnalyticalStorage": True, "enableBurstCapacity": True, "enableFreeTier": False, - "enableMaterializedViews": False, "enablePerRegionPerPartitionAutoscale": True, - "enablePriorityBasedExecution": True, "ipRules": [{"ipAddressOrRange": "23.43.230.120"}, {"ipAddressOrRange": "110.12.240.0/12"}], "isVirtualNetworkFilterEnabled": True, "keyVaultKeyUri": "https://myKeyVault.vault.azure.net", @@ -97,6 +93,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountCreateMax.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_create_min.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_create_min.py index e38b9b988bdc..ca4b1b0b9980 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_create_min.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_create_min.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountCreateMin.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_delete.py index 0862f09ffccd..d06d7e51c4a1 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_failover_priority_change.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_failover_priority_change.py index feb7653bfa7e..61a2c5c69c81 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_failover_priority_change.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_failover_priority_change.py @@ -42,6 +42,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get.py index 88fb88dea3d1..0ab4979af77a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get_metric_definitions.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get_metric_definitions.py index 1dcd5a3dc3fd..5a2cb73813c0 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get_metric_definitions.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get_metric_definitions.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get_metrics.py index cb3672b2988d..aa2b7c06eac3 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get_metrics.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get_metrics.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountGetMetrics.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get_usages.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get_usages.py index b6140eb96eeb..356f4c86e2fe 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get_usages.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get_usages.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGetUsages.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountGetUsages.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list.py index 85a742beada6..44028c5a4d64 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_by_resource_group.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_by_resource_group.py index 392d084fc51e..3e3973945fa0 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_by_resource_group.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListByResourceGroup.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_connection_strings.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_connection_strings.py index 82ee2dcb8821..51bfcd31fd06 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_connection_strings.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_connection_strings.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListConnectionStrings.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountListConnectionStrings.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_connection_strings_mongo.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_connection_strings_mongo.py index 7d54d21687ba..ef84c58ab6e7 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_connection_strings_mongo.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_connection_strings_mongo.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListConnectionStringsMongo.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountListConnectionStringsMongo.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_keys.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_keys.py index c6bb75fd8253..a72972fe80ef 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_keys.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_keys.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListKeys.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountListKeys.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_read_only_keys.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_read_only_keys.py index 6768d2d3810f..5ff0170ebbed 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_read_only_keys.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_read_only_keys.py @@ -30,13 +30,13 @@ def main(): subscription_id="subid", ) - response = client.database_accounts.list_read_only_keys( + response = client.database_accounts.get_read_only_keys( resource_group_name="rg1", account_name="ddb1", ) print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_offline_region.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_offline_region.py index bd30f69c78de..1014b937d37b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_offline_region.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_offline_region.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountOfflineRegion.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountOfflineRegion.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_online_region.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_online_region.py index 97ce62546383..fdc97bed7a92 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_online_region.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_online_region.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountOnlineRegion.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountOnlineRegion.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_patch.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_patch.py index 0962fdfd3222..1824ddffe0d0 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_patch.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_patch.py @@ -47,26 +47,22 @@ def main(): "periodicModeProperties": { "backupIntervalInMinutes": 240, "backupRetentionIntervalInHours": 720, - "backupStorageRedundancy": "Geo", + "backupStorageRedundancy": "Local", }, "type": "Periodic", }, "capacity": {"totalThroughputLimit": 2000}, - "capacityMode": "Provisioned", "consistencyPolicy": { "defaultConsistencyLevel": "BoundedStaleness", "maxIntervalInSeconds": 10, "maxStalenessPrefix": 200, }, "defaultIdentity": "FirstPartyIdentity", - "defaultPriorityLevel": "Low", - "diagnosticLogSettings": {"enableFullTextQuery": "True"}, "enableAnalyticalStorage": True, "enableBurstCapacity": True, "enableFreeTier": False, "enablePartitionMerge": True, "enablePerRegionPerPartitionAutoscale": True, - "enablePriorityBasedExecution": True, "ipRules": [{"ipAddressOrRange": "23.43.230.120"}, {"ipAddressOrRange": "110.12.240.0/12"}], "isVirtualNetworkFilterEnabled": True, "minimalTlsVersion": "Tls", @@ -87,6 +83,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountPatch.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountPatch.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_regenerate_key.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_regenerate_key.py index 6ab676945256..3b775dac5d76 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_regenerate_key.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_regenerate_key.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountRegenerateKey.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountRegenerateKey.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_region_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_region_get_metrics.py index 118be9911789..1431f3b00083 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_region_get_metrics.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_region_get_metrics.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountRegionGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountRegionGetMetrics.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_get_metric_definitions.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_get_metric_definitions.py index 23794fad4d0b..7f3038bd5d0b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_get_metric_definitions.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_get_metric_definitions.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseGetMetricDefinitions.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseGetMetricDefinitions.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_get_metrics.py index 1c49fae868c8..8204d1c63b41 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_get_metrics.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_get_metrics.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseGetMetrics.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_get_usages.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_get_usages.py index cb12d33c0aed..e364321ef76d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_get_usages.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_get_usages.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseGetUsages.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseGetUsages.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_create.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_create.py index 7c4e6337176c..3384fddde3ec 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_create.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_create.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphAPIComputeServiceCreate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGraphAPIComputeServiceCreate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_delete.py index d3946a977e52..8b6ff4097841 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphAPIComputeServiceDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGraphAPIComputeServiceDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_get.py index 0a98ba117778..050cbabb9ab9 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphAPIComputeServiceGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGraphAPIComputeServiceGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_create_update.py deleted file mode 100644 index 694d2ac43c6f..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_create_update.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_graph_resource_create_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.graph_resources.begin_create_update_graph( - resource_group_name="rg1", - account_name="ddb1", - graph_name="graphName", - create_update_graph_parameters={ - "location": "West US", - "properties": {"options": {}, "resource": {"id": "graphName"}}, - "tags": {}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceCreateUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_delete.py deleted file mode 100644 index 6386693bc541..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_graph_resource_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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - client.graph_resources.begin_delete_graph_resource( - resource_group_name="rg1", - account_name="ddb1", - graph_name="graphName", - ).result() - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_get.py deleted file mode 100644 index 2cacfa42ec0b..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_graph_resource_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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.graph_resources.get_graph( - resource_group_name="rg1", - account_name="ddb1", - graph_name="graphName", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceGet.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_list.py deleted file mode 100644 index 5e9fb9c203d0..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_list.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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_graph_resource_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.graph_resources.list_graphs( - resource_group_name="rgName", - account_name="ddb1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceList.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_create_update.py index d8f89568f7de..80ed41f602ff 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_create_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinDatabaseCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_delete.py index 621dd35634bc..915c6d3cf340 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinDatabaseDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_get.py index dc39fa9036b7..9e049ab3242c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinDatabaseGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_list.py index e31419ea246e..0bb5ce196b9e 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinDatabaseList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_migrate_to_autoscale.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_migrate_to_autoscale.py index ea3072c8a45b..eebc10047d2b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_migrate_to_autoscale.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_migrate_to_autoscale.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_migrate_to_manual_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_migrate_to_manual_throughput.py index ebb5456e91e1..8a21ee99b1b0 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_migrate_to_manual_throughput.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_migrate_to_manual_throughput.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_throughput_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_throughput_get.py index 3355dc5fe871..87406af59c10 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_throughput_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_throughput_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinDatabaseThroughputGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_throughput_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_throughput_update.py index 24342294e620..9e31424d9265 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_throughput_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_throughput_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinDatabaseThroughputUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_backup_information.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_backup_information.py index 95476c06adf8..eea492b79726 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_backup_information.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_backup_information.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphBackupInformation.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinGraphBackupInformation.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_create_update.py index f08c90e0669e..3cc40b235fa7 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_create_update.py @@ -67,6 +67,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinGraphCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_delete.py index 30476d68033a..b1660dbbca7b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinGraphDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_get.py index 06836ba23a76..48555433a24f 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinGraphGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_list.py index f007d2dbe957..877011e41c27 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinGraphList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_migrate_to_autoscale.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_migrate_to_autoscale.py index 8899375c50d3..a7f6910e3e3d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_migrate_to_autoscale.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_migrate_to_autoscale.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinGraphMigrateToAutoscale.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_migrate_to_manual_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_migrate_to_manual_throughput.py index 2df49be0e688..3fdcf68242a7 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_migrate_to_manual_throughput.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_migrate_to_manual_throughput.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_throughput_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_throughput_get.py index c7dac17318d8..44e625849c74 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_throughput_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_throughput_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinGraphThroughputGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_throughput_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_throughput_update.py index 16f646ce503d..e36d4f698a97 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_throughput_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_throughput_update.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinGraphThroughputUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_location_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_location_get.py index e7a9e245f5ea..74580ea0fc2d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_location_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_location_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBLocationGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBLocationGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_location_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_location_list.py index d9caeab6577c..31014e9fca32 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_location_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_location_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBLocationList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBLocationList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_backup.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_backup.py deleted file mode 100644 index 93747a09d8e7..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_backup.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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_managed_cassandra_backup.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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.cassandra_clusters.get_backup( - resource_group_name="cassandra-prod-rg", - cluster_name="cassandra-prod", - backup_id="1611250348", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraBackup.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_backups_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_backups_list.py deleted file mode 100644 index bba9f3eebfa4..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_backups_list.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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_managed_cassandra_backups_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.cassandra_clusters.list_backups( - resource_group_name="cassandra-prod-rg", - cluster_name="cassandra-prod", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraBackupsList.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_create.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_create.py index 9771e89620b4..625915b8ad22 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_create.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_create.py @@ -27,7 +27,7 @@ def main(): client = CosmosDBManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.cassandra_clusters.begin_create_update( @@ -60,6 +60,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterCreate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraClusterCreate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_deallocate.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_deallocate.py index f941b3d3db4a..979c7df8ad04 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_deallocate.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_deallocate.py @@ -27,7 +27,7 @@ def main(): client = CosmosDBManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) client.cassandra_clusters.begin_deallocate( @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterDeallocate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraClusterDeallocate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_delete.py index 7c7cda2015e0..1abe03fd7bc2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraClusterDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_get.py index 07699af51ecb..095b3ffd9326 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraClusterGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_list_by_resource_group.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_list_by_resource_group.py index 04f16373d5b9..ad22b0a0b36c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_list_by_resource_group.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_list_by_subscription.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_list_by_subscription.py index a1c771618a60..3890c803f532 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_list_by_subscription.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterListBySubscription.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraClusterListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_patch.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_patch.py index dddfaf32551d..091cd427cd6a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_patch.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_patch.py @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterPatch.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraClusterPatch.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_start.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_start.py index 135e7f663f8d..f423ca69f796 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_start.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_start.py @@ -27,7 +27,7 @@ def main(): client = CosmosDBManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) client.cassandra_clusters.begin_start( @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterStart.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraClusterStart.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_command.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_command.py index d3602d282cc7..47399a7ee42b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_command.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_command.py @@ -27,17 +27,17 @@ def main(): client = CosmosDBManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.cassandra_clusters.begin_invoke_command( resource_group_name="cassandra-prod-rg", cluster_name="cassandra-prod", - body={"arguments": {"status": ""}, "command": "nodetool", "host": "10.0.1.12"}, + body={"command": "nodetool status", "host": "10.0.1.12"}, ).result() print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraCommand.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraCommand.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_command_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_command_async.py deleted file mode 100644 index bf4e7ec735a3..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_command_async.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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_managed_cassandra_command_async.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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.cassandra_clusters.begin_invoke_command_async( - resource_group_name="cassandra-prod-rg", - cluster_name="cassandra-prod", - body={"arguments": {"status": ""}, "command": "nodetool", "host": "10.0.1.12"}, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraCommandAsync.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_command_result.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_command_result.py deleted file mode 100644 index 9063fc72ae95..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_command_result.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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_managed_cassandra_command_result.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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.cassandra_clusters.get_command_async( - resource_group_name="cassandra-prod-rg", - cluster_name="cassandra-prod", - command_id="318653d0-3da5-4814-b8f6-429f2af0b2a4", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraCommandResult.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_create.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_create.py index 8db47bd307b8..a6908ef07c27 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_create.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_create.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterCreate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraDataCenterCreate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_delete.py index 9f1db99955e1..f2872ffc57cf 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraDataCenterDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_get.py index 089a235a9c43..ddae164b6b59 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraDataCenterGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_list.py index ed3c309260f6..944994fec07e 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraDataCenterList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_patch.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_patch.py index 41f5c3fb4800..77d7f713a5f7 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_patch.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_patch.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterPatch.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraDataCenterPatch.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_list_command.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_list_command.py deleted file mode 100644 index eeae7b9a910f..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_list_command.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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_managed_cassandra_list_command.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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.cassandra_clusters.list_command( - resource_group_name="cassandra-prod-rg", - cluster_name="cassandra-prod", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraListCommand.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_status.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_status.py index fbbccac518a2..2503a5a356e0 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_status.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_status.py @@ -27,7 +27,7 @@ def main(): client = CosmosDBManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.cassandra_clusters.status( @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraStatus.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraStatus.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_create.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_create.py index cde713b49dcd..270a4541927d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_create.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_create.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_delete.py index 9a0fb9fdfc50..b254f6535cb9 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMaterializedViewsBuilderServiceDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_get.py index e2f98feb0860..173f8e990474 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMaterializedViewsBuilderServiceGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_backup_information.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_backup_information.py index cfc86e7a32fc..966c4f73b82d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_backup_information.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_backup_information.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionBackupInformation.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBCollectionBackupInformation.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_delete.py index 58f5ad515575..012852e6d85b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBCollectionDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_get.py index 1fd0d1fc2c66..363812c86d79 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBCollectionGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_list.py index 765e26ea5b05..2b77e068f109 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBCollectionList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_migrate_to_autoscale.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_migrate_to_autoscale.py index de1c81c976ee..836bfac6cece 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_migrate_to_autoscale.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_migrate_to_autoscale.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_migrate_to_manual_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_migrate_to_manual_throughput.py index e4982b7cb381..b8a8eb18613e 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_migrate_to_manual_throughput.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_migrate_to_manual_throughput.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_partition_merge.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_partition_merge.py deleted file mode 100644 index a7c716375600..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_partition_merge.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_mongo_db_collection_partition_merge.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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.mongo_db_resources.begin_list_mongo_db_collection_partition_merge( - resource_group_name="rgName", - account_name="ddb1", - database_name="databaseName", - collection_name="collectionName", - merge_parameters={"isDryRun": False}, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionPartitionMerge.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_redistribute_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_redistribute_throughput.py deleted file mode 100644 index b4243369d673..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_redistribute_throughput.py +++ /dev/null @@ -1,56 +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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_mongo_db_collection_redistribute_throughput.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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.mongo_db_resources.begin_mongo_db_container_redistribute_throughput( - resource_group_name="rg1", - account_name="ddb1", - database_name="databaseName", - collection_name="collectionName", - redistribute_throughput_parameters={ - "properties": { - "resource": { - "sourcePhysicalPartitionThroughputInfo": [{"id": "2", "throughput": 5000}, {"id": "3"}], - "targetPhysicalPartitionThroughputInfo": [ - {"id": "0", "throughput": 5000}, - {"id": "1", "throughput": 5000}, - ], - "throughputPolicy": "custom", - } - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionRedistributeThroughput.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_retrieve_throughput_distribution.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_retrieve_throughput_distribution.py deleted file mode 100644 index 204d54288cc7..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_retrieve_throughput_distribution.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_mongo_db_collection_retrieve_throughput_distribution.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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.mongo_db_resources.begin_mongo_db_container_retrieve_throughput_distribution( - resource_group_name="rg1", - account_name="ddb1", - database_name="databaseName", - collection_name="collectionName", - retrieve_throughput_parameters={ - "properties": {"resource": {"physicalPartitionIds": [{"id": "0"}, {"id": "1"}]}} - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionRetrieveThroughputDistribution.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_throughput_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_throughput_get.py index c6a925b23145..c567ec618be6 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_throughput_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_throughput_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBCollectionThroughputGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_throughput_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_throughput_update.py index 32e8ce7c4e4b..558972797495 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_throughput_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_throughput_update.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBCollectionThroughputUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_delete.py index de407301e9be..629e456844fe 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBDatabaseDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_get.py index 550c6cb5be43..2f825f0762a2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBDatabaseGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_list.py index c47fc0ef71be..9a839f1ec57f 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBDatabaseList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_migrate_to_autoscale.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_migrate_to_autoscale.py index e85e18efe1ec..5560babff7ac 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_migrate_to_autoscale.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_migrate_to_autoscale.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_migrate_to_manual_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_migrate_to_manual_throughput.py index 3c656878fbbd..2273b97484ba 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_migrate_to_manual_throughput.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_migrate_to_manual_throughput.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_partition_merge.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_partition_merge.py deleted file mode 100644 index 1bc8ae587bec..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_partition_merge.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_mongo_db_database_partition_merge.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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.mongo_db_resources.begin_mongo_db_database_partition_merge( - resource_group_name="rgName", - account_name="ddb1", - database_name="databaseName", - merge_parameters={"isDryRun": False}, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabasePartitionMerge.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_redistribute_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_redistribute_throughput.py deleted file mode 100644 index f8a99354b189..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_redistribute_throughput.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_mongo_db_database_redistribute_throughput.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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.mongo_db_resources.begin_mongo_db_database_redistribute_throughput( - resource_group_name="rg1", - account_name="ddb1", - database_name="databaseName", - redistribute_throughput_parameters={ - "properties": { - "resource": { - "sourcePhysicalPartitionThroughputInfo": [{"id": "2", "throughput": 5000}, {"id": "3"}], - "targetPhysicalPartitionThroughputInfo": [ - {"id": "0", "throughput": 5000}, - {"id": "1", "throughput": 5000}, - ], - "throughputPolicy": "custom", - } - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseRedistributeThroughput.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_retrieve_throughput_distribution.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_retrieve_throughput_distribution.py deleted file mode 100644 index 95527de542bc..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_retrieve_throughput_distribution.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_mongo_db_database_retrieve_throughput_distribution.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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.mongo_db_resources.begin_mongo_db_database_retrieve_throughput_distribution( - resource_group_name="rg1", - account_name="ddb1", - database_name="databaseName", - retrieve_throughput_parameters={ - "properties": {"resource": {"physicalPartitionIds": [{"id": "0"}, {"id": "1"}]}} - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseRetrieveThroughputDistribution.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_throughput_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_throughput_get.py index 1a591f6311b3..e6b93d287667 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_throughput_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_throughput_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBDatabaseThroughputGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_throughput_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_throughput_update.py index 57e980b816bf..8afe5da749ff 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_throughput_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_throughput_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_create_update.py index d349151a77c0..e2667d1f7979 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_create_update.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_delete.py index 72df42dbc5df..e2e15ba8fd45 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBRoleDefinitionDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_get.py index 1a675bb6e6f6..9842ed79bcee 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBRoleDefinitionGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_list.py index 193cae2fac18..fe74e1636851 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBRoleDefinitionList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_create_update.py index cb652436ac2c..17f9dafb38a4 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_create_update.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_delete.py index d5349ef86122..9a0e94cddc8b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBUserDefinitionDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_get.py index 2c678f3fa5a4..fc3bf4646dde 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBUserDefinitionGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_list.py index 117d025ba3e3..18911642572d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBUserDefinitionList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_delete.py index d668b21afa5d..4c7fd4358aa1 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBNotebookWorkspaceDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_get.py index 768e33684182..9ad4d38b6baa 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBNotebookWorkspaceGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_list.py index 406775ab117b..da843c901792 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBNotebookWorkspaceList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_list_connection_info.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_list_connection_info.py index 513c4160c866..c696e141ea37 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_list_connection_info.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_list_connection_info.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceListConnectionInfo.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBNotebookWorkspaceListConnectionInfo.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_regenerate_auth_token.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_regenerate_auth_token.py index 309502baa6bc..3458416085fc 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_regenerate_auth_token.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_regenerate_auth_token.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceRegenerateAuthToken.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBNotebookWorkspaceRegenerateAuthToken.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_start.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_start.py index 2a14f5c8c886..a29e977bb454 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_start.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_start.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceStart.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBNotebookWorkspaceStart.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_operations_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_operations_list.py index 2c326f145408..a7ba5a2dc430 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_operations_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_operations_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBOperationsList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBOperationsList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_get_metrics.py index 762b2ed2ea9c..7b558db40f28 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_get_metrics.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_get_metrics.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPercentileGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPercentileGetMetrics.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_source_target_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_source_target_get_metrics.py index f6d8f3e60da0..df55d4612ff2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_source_target_get_metrics.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_source_target_get_metrics.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPercentileSourceTargetGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPercentileSourceTargetGetMetrics.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_target_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_target_get_metrics.py index f4379ba6d740..d35b59bced78 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_target_get_metrics.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_target_get_metrics.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPercentileTargetGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPercentileTargetGetMetrics.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_delete.py index ab17ada1731f..9912fa86e492 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPrivateEndpointConnectionDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_get.py index bb34a31c9c2b..a049632d60c8 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPrivateEndpointConnectionGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_list_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_list_get.py index 8b5cac98eef6..154db1bd646a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_list_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_list_get.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionListGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPrivateEndpointConnectionListGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_update.py index cf796105aba5..d93d65d90d69 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_update.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPrivateEndpointConnectionUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_link_resource_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_link_resource_get.py index 8e0e2e6591b4..8f79ee719436 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_link_resource_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_link_resource_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateLinkResourceGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPrivateLinkResourceGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_link_resource_list_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_link_resource_list_get.py index 0b951204851a..f508ed0bd5ec 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_link_resource_list_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_link_resource_list_get.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateLinkResourceListGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPrivateLinkResourceListGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_region_collection_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_region_collection_get_metrics.py index f52afa08bb79..833af701070a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_region_collection_get_metrics.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_region_collection_get_metrics.py @@ -42,6 +42,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRegionCollectionGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRegionCollectionGetMetrics.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_database_account_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_database_account_get.py index e52bb182cf55..b0914364f6f8 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_database_account_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_database_account_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableDatabaseAccountGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_database_account_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_database_account_list.py index ffae60673c3c..a50533a12e26 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_database_account_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_database_account_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableDatabaseAccountList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_database_account_no_location_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_database_account_no_location_list.py index f82893416f57..2d6ba581dd4e 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_database_account_no_location_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_database_account_no_location_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_gremlin_database_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_gremlin_database_list.py index d13a8b43c052..0bb055c5fb70 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_gremlin_database_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_gremlin_database_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableGremlinDatabaseList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableGremlinDatabaseList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_gremlin_graph_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_gremlin_graph_list.py index 32153ec98c64..a427eb034a58 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_gremlin_graph_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_gremlin_graph_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableGremlinGraphList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableGremlinGraphList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_gremlin_resource_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_gremlin_resource_list.py index f475a6462ebd..3b656c1aef9a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_gremlin_resource_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_gremlin_resource_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableGremlinResourceList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableGremlinResourceList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_mongodb_collection_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_mongodb_collection_list.py index 854b41b03733..9f1f8d53fc11 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_mongodb_collection_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_mongodb_collection_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableMongodbCollectionList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableMongodbCollectionList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_mongodb_database_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_mongodb_database_list.py index 0807abd047fd..aecda262c62e 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_mongodb_database_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_mongodb_database_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableMongodbDatabaseList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableMongodbDatabaseList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_mongodb_resource_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_mongodb_resource_list.py index ceee6f435fb9..918e4b171b64 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_mongodb_resource_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_mongodb_resource_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableMongodbResourceList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableMongodbResourceList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_sql_container_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_sql_container_list.py index 03071c7e4b85..d3001971e54c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_sql_container_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_sql_container_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableSqlContainerList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableSqlContainerList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_sql_database_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_sql_database_list.py index a0f4a18974f6..ae09b1afc9cd 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_sql_database_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_sql_database_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableSqlDatabaseList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableSqlDatabaseList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_sql_resource_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_sql_resource_list.py index 6a912b3b6809..2b9087b1d18b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_sql_resource_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_sql_resource_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableSqlResourceList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableSqlResourceList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_table_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_table_list.py index bf12bc6ffb38..77b889575439 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_table_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_table_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableTableList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableTableList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_table_resource_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_table_resource_list.py index 69526d6028c8..609b990c1027 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_table_resource_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_table_resource_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableTableResourceList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableTableResourceList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restore_database_account_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restore_database_account_create_update.py index f65f27b5ecab..41ff50f4eff0 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restore_database_account_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restore_database_account_create_update.py @@ -48,7 +48,6 @@ def main(): "databaseAccountOfferType": "Standard", "enableAnalyticalStorage": True, "enableFreeTier": False, - "enableMaterializedViews": False, "keyVaultKeyUri": "https://myKeyVault.vault.azure.net", "locations": [{"failoverPriority": 0, "isZoneRedundant": False, "locationName": "southcentralus"}], "minimalTlsVersion": "Tls", @@ -61,7 +60,6 @@ def main(): "restoreSource": "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/1a97b4bb-f6a0-430e-ade1-638d781830cc", "restoreTimestampInUtc": "2021-03-11T22:05:09Z", "restoreWithTtlDisabled": False, - "sourceBackupLocation": "westus", }, }, "tags": {}, @@ -70,6 +68,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestoreDatabaseAccountCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestoreDatabaseAccountCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_services_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_services_list.py index a018af7039ff..73ef57b3b25c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_services_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_services_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBServicesList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBServicesList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_create_update.py index 1f51fcccf3c9..133d48f09f42 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_create_update.py @@ -46,7 +46,7 @@ def main(): "type": "AzureKeyVault", "value": "AzureKeyVault Key URL", }, - "wrappedDataEncryptionKey": "VGhpcyBpcyBhY3R1YWxseSBhbiBhcnJheSBvZiBieXRlcy4gVGhpcyByZXF1ZXN0L3Jlc3BvbnNlIGlzIGJlaW5nIHByZXNlbnRlZCBhcyBhIHN0cmluZyBmb3IgcmVhZGFiaWxpdHkgaW4gdGhlIGV4YW1wbGU=", + "wrappedDataEncryptionKey": "U3dhZ2dlciByb2Nrcw==", } } }, @@ -54,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_get.py index 60606805fdf8..690d4dc30e72 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlClientEncryptionKeyGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_keys_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_keys_list.py index c0c460b99d99..f6bf8fa4ed11 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_keys_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_keys_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeysList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlClientEncryptionKeysList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_backup_information.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_backup_information.py index fd7c354eb882..99e13f329b2d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_backup_information.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_backup_information.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerBackupInformation.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlContainerBackupInformation.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_create_update.py index 7f8b179956ed..9af55ec680e2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_create_update.py @@ -54,6 +54,14 @@ def main(): "computedProperties": [{"name": "cp_lowerName", "query": "SELECT VALUE LOWER(c.name) FROM c"}], "conflictResolutionPolicy": {"conflictResolutionPath": "/path", "mode": "LastWriterWins"}, "defaultTtl": 100, + "fullTextPolicy": { + "defaultLanguage": "1033", + "fullTextPaths": [ + {"language": "en-US", "path": "/ftPath1"}, + {"language": "fr-FR", "path": "/ftPath2"}, + {"language": "de-DE", "path": "/ftPath3"}, + ], + }, "id": "containerName", "indexingPolicy": { "automatic": True, @@ -106,6 +114,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlContainerCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_delete.py index 072592bfe19d..dab07fa9daa7 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlContainerDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_get.py index 7b6303457bee..5c78faac6fbe 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlContainerGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_list.py index 4d326508a2bc..c8b90dcfd1f5 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlContainerList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_migrate_to_autoscale.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_migrate_to_autoscale.py index 59e5a9a7ae55..177ca0958001 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_migrate_to_autoscale.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_migrate_to_autoscale.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlContainerMigrateToAutoscale.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_migrate_to_manual_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_migrate_to_manual_throughput.py index c8591e7ab507..3685c9ccc9de 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_migrate_to_manual_throughput.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_migrate_to_manual_throughput.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlContainerMigrateToManualThroughput.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_partition_merge.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_partition_merge.py deleted file mode 100644 index c28a8125033e..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_partition_merge.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_sql_container_partition_merge.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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.sql_resources.begin_list_sql_container_partition_merge( - resource_group_name="rgName", - account_name="ddb1", - database_name="databaseName", - container_name="containerName", - merge_parameters={"isDryRun": False}, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerPartitionMerge.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_redistribute_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_redistribute_throughput.py deleted file mode 100644 index 5839e26749bd..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_redistribute_throughput.py +++ /dev/null @@ -1,56 +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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_sql_container_redistribute_throughput.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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.sql_resources.begin_sql_container_redistribute_throughput( - resource_group_name="rg1", - account_name="ddb1", - database_name="databaseName", - container_name="containerName", - redistribute_throughput_parameters={ - "properties": { - "resource": { - "sourcePhysicalPartitionThroughputInfo": [{"id": "2", "throughput": 5000}, {"id": "3"}], - "targetPhysicalPartitionThroughputInfo": [ - {"id": "0", "throughput": 5000}, - {"id": "1", "throughput": 5000}, - ], - "throughputPolicy": "custom", - } - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerRedistributeThroughput.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_restore.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_restore.py deleted file mode 100644 index dc7d3c6060bf..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_restore.py +++ /dev/null @@ -1,60 +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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_sql_container_restore.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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.sql_resources.begin_create_update_sql_container( - resource_group_name="rg1", - account_name="ddb1", - database_name="databaseName", - container_name="containerName", - create_update_sql_container_parameters={ - "location": "West US", - "properties": { - "options": {}, - "resource": { - "createMode": "Restore", - "id": "containerName", - "restoreParameters": { - "restoreSource": "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - "restoreTimestampInUtc": "2022-07-20T18:28:00Z", - "restoreWithTtlDisabled": True, - }, - }, - }, - "tags": {}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerRestore.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_retrieve_throughput_distribution.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_retrieve_throughput_distribution.py deleted file mode 100644 index fae8dbc6d8b9..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_retrieve_throughput_distribution.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_sql_container_retrieve_throughput_distribution.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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.sql_resources.begin_sql_container_retrieve_throughput_distribution( - resource_group_name="rg1", - account_name="ddb1", - database_name="databaseName", - container_name="containerName", - retrieve_throughput_parameters={ - "properties": {"resource": {"physicalPartitionIds": [{"id": "0"}, {"id": "1"}]}} - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerRetrieveThroughputDistribution.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_throughput_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_throughput_get.py index 8062c7ce3a1f..0aabb361b4fd 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_throughput_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_throughput_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlContainerThroughputGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_throughput_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_throughput_update.py index 050f04f8b73b..15af1e214eb0 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_throughput_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_throughput_update.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlContainerThroughputUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_create_update.py index 82e5047e5127..486f7055c11a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_create_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlDatabaseCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_delete.py index 2dc66cda0858..93014f39d731 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlDatabaseDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_get.py index e0c1cf72fae2..a5021c08bcec 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlDatabaseGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_list.py index b01a490ca821..ecec39aa87e2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlDatabaseList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_migrate_to_autoscale.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_migrate_to_autoscale.py index b4710f1a2b0a..1ea797c003fd 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_migrate_to_autoscale.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_migrate_to_autoscale.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_migrate_to_manual_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_migrate_to_manual_throughput.py index b4c4e019d49d..632c0817cbe7 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_migrate_to_manual_throughput.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_migrate_to_manual_throughput.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_partition_merge.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_partition_merge.py deleted file mode 100644 index f76ff97402bb..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_partition_merge.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_sql_database_partition_merge.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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.sql_resources.begin_sql_database_partition_merge( - resource_group_name="rgName", - account_name="ddb1", - database_name="databaseName", - merge_parameters={"isDryRun": False}, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabasePartitionMerge.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_redistribute_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_redistribute_throughput.py deleted file mode 100644 index 0a85f610a795..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_redistribute_throughput.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_sql_database_redistribute_throughput.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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.sql_resources.begin_sql_database_redistribute_throughput( - resource_group_name="rg1", - account_name="ddb1", - database_name="databaseName", - redistribute_throughput_parameters={ - "properties": { - "resource": { - "sourcePhysicalPartitionThroughputInfo": [{"id": "2", "throughput": 5000}, {"id": "3"}], - "targetPhysicalPartitionThroughputInfo": [ - {"id": "0", "throughput": 5000}, - {"id": "1", "throughput": 5000}, - ], - "throughputPolicy": "custom", - } - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseRedistributeThroughput.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_restore.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_restore.py deleted file mode 100644 index e1d8ee3ca826..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_restore.py +++ /dev/null @@ -1,59 +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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_sql_database_restore.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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.sql_resources.begin_create_update_sql_database( - resource_group_name="rg1", - account_name="ddb1", - database_name="databaseName", - create_update_sql_database_parameters={ - "location": "West US", - "properties": { - "options": {}, - "resource": { - "createMode": "Restore", - "id": "databaseName", - "restoreParameters": { - "restoreSource": "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - "restoreTimestampInUtc": "2022-07-20T18:28:00Z", - "restoreWithTtlDisabled": True, - }, - }, - }, - "tags": {}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseRestore.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_retrieve_throughput_distribution.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_retrieve_throughput_distribution.py deleted file mode 100644 index cf1f9d55f014..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_retrieve_throughput_distribution.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_sql_database_retrieve_throughput_distribution.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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.sql_resources.begin_sql_database_retrieve_throughput_distribution( - resource_group_name="rg1", - account_name="ddb1", - database_name="databaseName", - retrieve_throughput_parameters={ - "properties": {"resource": {"physicalPartitionIds": [{"id": "0"}, {"id": "1"}]}} - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseRetrieveThroughputDistribution.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_throughput_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_throughput_get.py index 41bd2fdbfd7a..a0cd5fe11529 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_throughput_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_throughput_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlDatabaseThroughputGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_throughput_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_throughput_update.py index 016074eb5c1d..9ee32356e1f8 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_throughput_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_throughput_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlDatabaseThroughputUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_materialized_view_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_materialized_view_create_update.py deleted file mode 100644 index 311e29181cf5..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_materialized_view_create_update.py +++ /dev/null @@ -1,73 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_sql_materialized_view_create_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.sql_resources.begin_create_update_sql_container( - resource_group_name="rg1", - account_name="ddb1", - database_name="databaseName", - container_name="mvContainerName", - create_update_sql_container_parameters={ - "location": "West US", - "properties": { - "options": {}, - "resource": { - "id": "mvContainerName", - "indexingPolicy": { - "automatic": True, - "excludedPaths": [], - "includedPaths": [ - { - "indexes": [ - {"dataType": "String", "kind": "Range", "precision": -1}, - {"dataType": "Number", "kind": "Range", "precision": -1}, - ], - "path": "/*", - } - ], - "indexingMode": "consistent", - }, - "materializedViewDefinition": { - "definition": "select * from ROOT", - "sourceCollectionId": "sourceContainerName", - }, - "partitionKey": {"kind": "Hash", "paths": ["/mvpk"]}, - }, - }, - "tags": {}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlMaterializedViewCreateUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_create_update.py index 2d0fa05dd251..4b44d77bc806 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_create_update.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_delete.py index 5b66bd44410e..d262f8a078c5 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlRoleAssignmentDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_get.py index 45174d66b681..147217805777 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlRoleAssignmentGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_list.py index c096498bfa8f..c5de9891d67c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlRoleAssignmentList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_create_update.py index e88283d5c382..e0e743363508 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_create_update.py @@ -57,6 +57,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_delete.py index 97bb02f3f631..eae411efd89f 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlRoleDefinitionDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_get.py index 7fac7289ef0c..e89b5a47aea4 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlRoleDefinitionGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_list.py index 6c88173615a6..ba606341bbd9 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlRoleDefinitionList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_create_update.py index 606f3b6b6037..3f26d3a8e808 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_create_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlStoredProcedureCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_delete.py index b7bb11e9e77d..4f50406e376c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_delete.py @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlStoredProcedureDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_get.py index 732b819bedf6..1e0cae7f98ee 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlStoredProcedureGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_list.py index 2fb3ee58ef4d..892099d76f85 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_list.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlStoredProcedureList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_create_update.py index 589d6e49bc55..3766a403d0a6 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_create_update.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlTriggerCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_delete.py index f7786f5798c6..6ad8ccef3210 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_delete.py @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlTriggerDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_get.py index 521ad8878335..2aa82a487867 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlTriggerGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_list.py index 89921fe0ad9f..dab43d0c5f7e 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_list.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlTriggerList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_create_update.py index c025dedab3e7..d9ec2cf736eb 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_create_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_delete.py index 9158cb1f15b3..577dc0c7287b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_delete.py @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlUserDefinedFunctionDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_get.py index 19d76fef6cbd..4973c5eda170 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlUserDefinedFunctionGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_list.py index 5194d874c8d7..d035278f10a3 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_list.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlUserDefinedFunctionList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_backup_information.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_backup_information.py index 57fb4cbd69c5..6f0c0c6ca0b3 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_backup_information.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_backup_information.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableBackupInformation.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBTableBackupInformation.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_create_update.py index d56c657ae9e0..282374cb2915 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_create_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBTableCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_delete.py index 4169841cfaed..d8885318b340 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBTableDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_get.py index 214ac243dada..4a13b4e42eea 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBTableGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_list.py index d3c246294b93..898a277141b6 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBTableList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_migrate_to_autoscale.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_migrate_to_autoscale.py index 892577e2703c..0bbce0c9b91f 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_migrate_to_autoscale.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_migrate_to_autoscale.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBTableMigrateToAutoscale.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_migrate_to_manual_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_migrate_to_manual_throughput.py index 7edb5de2ebbf..ff32702d1c11 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_migrate_to_manual_throughput.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_migrate_to_manual_throughput.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBTableMigrateToManualThroughput.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_throughput_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_throughput_get.py index f9b7a544491c..38876126a889 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_throughput_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_throughput_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBTableThroughputGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_throughput_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_throughput_update.py index 2c7be791cd31..07ed0543f5c2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_throughput_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_throughput_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBTableThroughputUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_dbp_key_range_id_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_dbp_key_range_id_get_metrics.py index c1f3b1aeee21..3ead55989b33 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_dbp_key_range_id_get_metrics.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_dbp_key_range_id_get_metrics.py @@ -42,6 +42,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPKeyRangeIdGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPKeyRangeIdGetMetrics.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_dbp_key_range_id_region_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_dbp_key_range_id_region_get_metrics.py index c9f1aa263116..4a6ba3a503dc 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_dbp_key_range_id_region_get_metrics.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_dbp_key_range_id_region_get_metrics.py @@ -43,6 +43,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_cancel.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_cancel.py deleted file mode 100644 index 22195757d60e..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_cancel.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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_data_transfer_job_cancel.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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.data_transfer_jobs.cancel( - resource_group_name="rg1", - account_name="ddb1", - job_name="j1", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobCancel.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_complete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_complete.py deleted file mode 100644 index 1b136b45cbf9..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_complete.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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_data_transfer_job_complete.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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="e35cc6eb-c8e3-447b-8de6-b83328cd0098", - ) - - response = client.data_transfer_jobs.complete( - resource_group_name="rg1", - account_name="ddb1", - job_name="j1", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobComplete.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_create.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_create.py deleted file mode 100644 index 8fc2debe67b9..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_create.py +++ /dev/null @@ -1,53 +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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_data_transfer_job_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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.data_transfer_jobs.create( - resource_group_name="rg1", - account_name="ddb1", - job_name="j1", - job_create_parameters={ - "properties": { - "destination": { - "component": "AzureBlobStorage", - "containerName": "blob_container", - "endpointUrl": "https://blob.windows.net", - }, - "source": {"component": "CosmosDBCassandra", "keyspaceName": "keyspace", "tableName": "table"}, - } - }, - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_feed.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_feed.py deleted file mode 100644 index 9cf43ff90542..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_feed.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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_data_transfer_job_feed.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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.data_transfer_jobs.list_by_database_account( - resource_group_name="rg1", - account_name="ddb1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobFeed.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_get.py deleted file mode 100644 index 98dd58066362..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_data_transfer_job_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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.data_transfer_jobs.get( - resource_group_name="rg1", - account_name="ddb1", - job_name="j1", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_pause.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_pause.py deleted file mode 100644 index 2e0b02952ef8..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_pause.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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_data_transfer_job_pause.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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.data_transfer_jobs.pause( - resource_group_name="rg1", - account_name="ddb1", - job_name="j1", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobPause.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_resume.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_resume.py deleted file mode 100644 index 587bccc8a438..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_resume.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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_data_transfer_job_resume.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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.data_transfer_jobs.resume( - resource_group_name="rg1", - account_name="ddb1", - job_name="j1", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobResume.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/network_security_perimeter_configuration_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/network_security_perimeter_configuration_get.py deleted file mode 100644 index e02d8b70e736..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/network_security_perimeter_configuration_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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python network_security_perimeter_configuration_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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.network_security_perimeter_configurations.get( - resource_group_name="res4410", - account_name="cosmosTest", - network_security_perimeter_configuration_name="dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/NetworkSecurityPerimeterConfigurationGet.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/network_security_perimeter_configuration_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/network_security_perimeter_configuration_list.py deleted file mode 100644 index 0621027f3c5e..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/network_security_perimeter_configuration_list.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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python network_security_perimeter_configuration_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.network_security_perimeter_configurations.list( - resource_group_name="res4410", - account_name="cosmosTest", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/NetworkSecurityPerimeterConfigurationList.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/network_security_perimeter_configuration_reconcile.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/network_security_perimeter_configuration_reconcile.py deleted file mode 100644 index 380962a01164..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/network_security_perimeter_configuration_reconcile.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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python network_security_perimeter_configuration_reconcile.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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - client.network_security_perimeter_configurations.begin_reconcile( - resource_group_name="res4410", - account_name="sto8607", - network_security_perimeter_configuration_name="dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1", - ).result() - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/NetworkSecurityPerimeterConfigurationReconcile.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/services/sqldedicatedgateway/cosmos_db_sql_dedicated_gateway_service_create.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/services/sqldedicatedgateway/cosmos_db_sql_dedicated_gateway_service_create.py index f4f3f8f0aed9..9ed2c4e986d3 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/services/sqldedicatedgateway/cosmos_db_sql_dedicated_gateway_service_create.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/services/sqldedicatedgateway/cosmos_db_sql_dedicated_gateway_service_create.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/services/sqldedicatedgateway/cosmos_db_sql_dedicated_gateway_service_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/services/sqldedicatedgateway/cosmos_db_sql_dedicated_gateway_service_delete.py index 0405976d644a..ea970a819b2b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/services/sqldedicatedgateway/cosmos_db_sql_dedicated_gateway_service_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/services/sqldedicatedgateway/cosmos_db_sql_dedicated_gateway_service_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/services/sqldedicatedgateway/cosmos_db_sql_dedicated_gateway_service_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/services/sqldedicatedgateway/cosmos_db_sql_dedicated_gateway_service_get.py index 5bc2dc62ff76..560c54d3e12d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/services/sqldedicatedgateway/cosmos_db_sql_dedicated_gateway_service_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/services/sqldedicatedgateway/cosmos_db_sql_dedicated_gateway_service_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_assignment_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_assignment_create_update.py deleted file mode 100644 index 86b8bcc50e7c..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_assignment_create_update.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_table_role_assignment_create_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.table_resources.begin_create_update_table_role_assignment( - resource_group_name="myResourceGroupName", - account_name="myAccountName", - role_assignment_id="myRoleAssignmentId", - create_update_table_role_assignment_parameters={ - "properties": { - "principalId": "myPrincipalId", - "roleDefinitionId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/tableRoleDefinitions/myRoleDefinitionId", - "scope": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases/colls/redmond-purchases", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentCreateUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_assignment_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_assignment_delete.py deleted file mode 100644 index 548b5e011dde..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_assignment_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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_table_role_assignment_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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - client.table_resources.begin_delete_table_role_assignment( - resource_group_name="myResourceGroupName", - account_name="myAccountName", - role_assignment_id="myRoleAssignmentId", - ).result() - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_assignment_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_assignment_get.py deleted file mode 100644 index af381fc3ba14..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_assignment_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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_table_role_assignment_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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.table_resources.get_table_role_assignment( - resource_group_name="myResourceGroupName", - account_name="myAccountName", - role_assignment_id="myRoleAssignmentId", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentGet.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_assignment_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_assignment_list.py deleted file mode 100644 index 4a7a4425a9a4..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_assignment_list.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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_table_role_assignment_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.table_resources.list_table_role_assignments( - resource_group_name="myResourceGroupName", - account_name="myAccountName", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentList.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_definition_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_definition_create_update.py deleted file mode 100644 index 7e18a273ed5e..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_definition_create_update.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 azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_table_role_definition_create_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.table_resources.begin_create_update_table_role_definition( - resource_group_name="myResourceGroupName", - account_name="myAccountName", - role_definition_id="myRoleDefinitionId", - create_update_table_role_definition_parameters={ - "properties": { - "assignableScopes": [ - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/sales", - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases", - ], - "permissions": [ - { - "dataActions": [ - "Microsoft.DocumentDB/databaseAccounts/tableDatabases/containers/entities/create", - "Microsoft.DocumentDB/databaseAccounts/tableDatabases/containers/entities/read", - ], - "notDataActions": [], - } - ], - "roleName": "myRoleName", - "type": "CustomRole", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionCreateUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_definition_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_definition_delete.py deleted file mode 100644 index 55bd7cf925bf..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_definition_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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_table_role_definition_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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - client.table_resources.begin_delete_table_role_definition( - resource_group_name="myResourceGroupName", - account_name="myAccountName", - role_definition_id="myRoleDefinitionId", - ).result() - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_definition_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_definition_get.py deleted file mode 100644 index a0b942da09c7..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_definition_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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_table_role_definition_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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.table_resources.get_table_role_definition( - resource_group_name="myResourceGroupName", - account_name="myAccountName", - role_definition_id="myRoleDefinitionId", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionGet.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_definition_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_definition_list.py deleted file mode 100644 index 94602ee6e72f..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/tablerbac/cosmos_db_table_role_definition_list.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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_table_role_definition_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.table_resources.list_table_role_definitions( - resource_group_name="myResourceGroupName", - account_name="myAccountName", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionList.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_account_create.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_account_create.py deleted file mode 100644 index 2034a31ed5f6..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_account_create.py +++ /dev/null @@ -1,49 +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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_throughput_pool_account_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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.throughput_pool_account.begin_create( - resource_group_name="rg1", - throughput_pool_name="tp1", - throughput_pool_account_name="db1", - body={ - "properties": { - "accountLocation": "West US", - "accountResourceIdentifier": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DocumentDB/resourceGroup/rg1/databaseAccounts/db1/", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_account_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_account_delete.py deleted file mode 100644 index 0d52497dca0e..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_account_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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_throughput_pool_account_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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - client.throughput_pool_account.begin_delete( - resource_group_name="rgName", - throughput_pool_name="tp1", - throughput_pool_account_name="db1", - ).result() - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_account_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_account_get.py deleted file mode 100644 index 08ef11a49a93..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_account_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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_throughput_pool_account_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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.throughput_pool_account.get( - resource_group_name="rgName", - throughput_pool_name="tp1", - throughput_pool_account_name="db1", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_accounts_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_accounts_list.py deleted file mode 100644 index 3776e3805b27..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_accounts_list.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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_throughput_pool_accounts_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.throughput_pool_accounts.list( - resource_group_name="rgName", - throughput_pool_name="tp1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountsList.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_create.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_create.py deleted file mode 100644 index 81e562ea622e..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_create.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_throughput_pool_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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.throughput_pool.begin_create_or_update( - resource_group_name="rg1", - throughput_pool_name="tp1", - body={"location": "westus2", "properties": {"maxThroughput": 10000}, "tags": {}}, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_delete.py deleted file mode 100644 index a70b3fe2feef..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_throughput_pool_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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - client.throughput_pool.begin_delete( - resource_group_name="rgName", - throughput_pool_name="tp1", - ).result() - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_get.py deleted file mode 100644 index 76d676bc6243..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_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.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_throughput_pool_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 = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.throughput_pool.get( - resource_group_name="rgName", - throughput_pool_name="tp1", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_list.py deleted file mode 100644 index 39ae1ec3d9f7..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_list.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_throughput_pool_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.throughput_pools.list_by_resource_group( - resource_group_name="rgName", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolList.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_update.py deleted file mode 100644 index 639bb62cce05..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_update.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_throughput_pool_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.throughput_pool.begin_update( - resource_group_name="rg1", - throughput_pool_name="tp1", - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_clusters_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_clusters_operations.py index abfdc2a0c2c6..fd19333352e0 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_clusters_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_clusters_operations.py @@ -22,7 +22,7 @@ def setup_method(self, method): @recorded_by_proxy def test_cassandra_clusters_list_by_subscription(self, resource_group): response = self.client.cassandra_clusters.list_by_subscription( - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -33,7 +33,7 @@ def test_cassandra_clusters_list_by_subscription(self, resource_group): def test_cassandra_clusters_list_by_resource_group(self, resource_group): response = self.client.cassandra_clusters.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_cassandra_clusters_get(self, resource_group): response = self.client.cassandra_clusters.get( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -57,7 +57,7 @@ def test_cassandra_clusters_begin_delete(self, resource_group): response = self.client.cassandra_clusters.begin_delete( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -76,18 +76,13 @@ def test_cassandra_clusters_begin_create_update(self, resource_group): "name": "str", "properties": { "authenticationMethod": "str", - "autoReplicate": "str", "azureConnectionMethod": "str", - "backupSchedules": [{"cronExpression": "str", "retentionInHours": 0, "scheduleName": "str"}], "cassandraAuditLoggingEnabled": bool, "cassandraVersion": "str", "clientCertificates": [{"pem": "str"}], "clusterNameOverride": "str", - "clusterType": "str", "deallocated": bool, "delegatedManagementSubnetId": "str", - "extensions": ["str"], - "externalDataCenters": ["str"], "externalGossipCertificates": [{"pem": "str"}], "externalSeedNodes": [{"ipAddress": "str"}], "gossipCertificates": [{"pem": "str"}], @@ -99,13 +94,12 @@ def test_cassandra_clusters_begin_create_update(self, resource_group): "provisioningState": "str", "repairEnabled": bool, "restoreFromBackupId": "str", - "scheduledEventStrategy": "str", "seedNodes": [{"ipAddress": "str"}], }, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -124,18 +118,13 @@ def test_cassandra_clusters_begin_update(self, resource_group): "name": "str", "properties": { "authenticationMethod": "str", - "autoReplicate": "str", "azureConnectionMethod": "str", - "backupSchedules": [{"cronExpression": "str", "retentionInHours": 0, "scheduleName": "str"}], "cassandraAuditLoggingEnabled": bool, "cassandraVersion": "str", "clientCertificates": [{"pem": "str"}], "clusterNameOverride": "str", - "clusterType": "str", "deallocated": bool, "delegatedManagementSubnetId": "str", - "extensions": ["str"], - "externalDataCenters": ["str"], "externalGossipCertificates": [{"pem": "str"}], "externalSeedNodes": [{"ipAddress": "str"}], "gossipCertificates": [{"pem": "str"}], @@ -147,13 +136,12 @@ def test_cassandra_clusters_begin_update(self, resource_group): "provisioningState": "str", "repairEnabled": bool, "restoreFromBackupId": "str", - "scheduledEventStrategy": "str", "seedNodes": [{"ipAddress": "str"}], }, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -172,82 +160,19 @@ def test_cassandra_clusters_begin_invoke_command(self, resource_group): "cassandra-stop-start": bool, "readwrite": bool, }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).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_cassandra_clusters_begin_invoke_command_async(self, resource_group): - response = self.client.cassandra_clusters.begin_invoke_command_async( - resource_group_name=resource_group.name, - cluster_name="str", - body={"command": "str", "host": "str", "arguments": {}, "cassandra-stop-start": bool, "readWrite": bool}, - api_version="2024-12-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_cassandra_clusters_list_command(self, resource_group): - response = self.client.cassandra_clusters.list_command( - resource_group_name=resource_group.name, - cluster_name="str", - api_version="2024-12-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_cassandra_clusters_get_command_async(self, resource_group): - response = self.client.cassandra_clusters.get_command_async( - resource_group_name=resource_group.name, - cluster_name="str", - command_id="str", - api_version="2024-12-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_cassandra_clusters_list_backups(self, resource_group): - response = self.client.cassandra_clusters.list_backups( - resource_group_name=resource_group.name, - cluster_name="str", - api_version="2024-12-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_cassandra_clusters_get_backup(self, resource_group): - response = self.client.cassandra_clusters.get_backup( - resource_group_name=resource_group.name, - cluster_name="str", - backup_id="str", - api_version="2024-12-01-preview", - ) - - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_cassandra_clusters_begin_deallocate(self, resource_group): response = self.client.cassandra_clusters.begin_deallocate( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -259,7 +184,7 @@ def test_cassandra_clusters_begin_start(self, resource_group): response = self.client.cassandra_clusters.begin_start( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -271,7 +196,7 @@ def test_cassandra_clusters_status(self, resource_group): response = self.client.cassandra_clusters.status( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_clusters_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_clusters_operations_async.py index f09208559630..45056d7a820b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_clusters_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_clusters_operations_async.py @@ -23,7 +23,7 @@ def setup_method(self, method): @recorded_by_proxy_async async def test_cassandra_clusters_list_by_subscription(self, resource_group): response = self.client.cassandra_clusters.list_by_subscription( - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -34,7 +34,7 @@ async def test_cassandra_clusters_list_by_subscription(self, resource_group): async def test_cassandra_clusters_list_by_resource_group(self, resource_group): response = self.client.cassandra_clusters.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_cassandra_clusters_get(self, resource_group): response = await self.client.cassandra_clusters.get( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -59,7 +59,7 @@ async def test_cassandra_clusters_begin_delete(self, resource_group): await self.client.cassandra_clusters.begin_delete( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -80,18 +80,13 @@ async def test_cassandra_clusters_begin_create_update(self, resource_group): "name": "str", "properties": { "authenticationMethod": "str", - "autoReplicate": "str", "azureConnectionMethod": "str", - "backupSchedules": [{"cronExpression": "str", "retentionInHours": 0, "scheduleName": "str"}], "cassandraAuditLoggingEnabled": bool, "cassandraVersion": "str", "clientCertificates": [{"pem": "str"}], "clusterNameOverride": "str", - "clusterType": "str", "deallocated": bool, "delegatedManagementSubnetId": "str", - "extensions": ["str"], - "externalDataCenters": ["str"], "externalGossipCertificates": [{"pem": "str"}], "externalSeedNodes": [{"ipAddress": "str"}], "gossipCertificates": [{"pem": "str"}], @@ -108,13 +103,12 @@ async def test_cassandra_clusters_begin_create_update(self, resource_group): "provisioningState": "str", "repairEnabled": bool, "restoreFromBackupId": "str", - "scheduledEventStrategy": "str", "seedNodes": [{"ipAddress": "str"}], }, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -135,18 +129,13 @@ async def test_cassandra_clusters_begin_update(self, resource_group): "name": "str", "properties": { "authenticationMethod": "str", - "autoReplicate": "str", "azureConnectionMethod": "str", - "backupSchedules": [{"cronExpression": "str", "retentionInHours": 0, "scheduleName": "str"}], "cassandraAuditLoggingEnabled": bool, "cassandraVersion": "str", "clientCertificates": [{"pem": "str"}], "clusterNameOverride": "str", - "clusterType": "str", "deallocated": bool, "delegatedManagementSubnetId": "str", - "extensions": ["str"], - "externalDataCenters": ["str"], "externalGossipCertificates": [{"pem": "str"}], "externalSeedNodes": [{"ipAddress": "str"}], "gossipCertificates": [{"pem": "str"}], @@ -163,13 +152,12 @@ async def test_cassandra_clusters_begin_update(self, resource_group): "provisioningState": "str", "repairEnabled": bool, "restoreFromBackupId": "str", - "scheduledEventStrategy": "str", "seedNodes": [{"ipAddress": "str"}], }, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -190,84 +178,13 @@ async def test_cassandra_clusters_begin_invoke_command(self, resource_group): "cassandra-stop-start": bool, "readwrite": bool, }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).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_cassandra_clusters_begin_invoke_command_async(self, resource_group): - response = await ( - await self.client.cassandra_clusters.begin_invoke_command_async( - resource_group_name=resource_group.name, - cluster_name="str", - body={ - "command": "str", - "host": "str", - "arguments": {}, - "cassandra-stop-start": bool, - "readWrite": bool, - }, - api_version="2024-12-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_cassandra_clusters_list_command(self, resource_group): - response = self.client.cassandra_clusters.list_command( - resource_group_name=resource_group.name, - cluster_name="str", - api_version="2024-12-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_cassandra_clusters_get_command_async(self, resource_group): - response = await self.client.cassandra_clusters.get_command_async( - resource_group_name=resource_group.name, - cluster_name="str", - command_id="str", - api_version="2024-12-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_cassandra_clusters_list_backups(self, resource_group): - response = self.client.cassandra_clusters.list_backups( - resource_group_name=resource_group.name, - cluster_name="str", - api_version="2024-12-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_cassandra_clusters_get_backup(self, resource_group): - response = await self.client.cassandra_clusters.get_backup( - resource_group_name=resource_group.name, - cluster_name="str", - backup_id="str", - api_version="2024-12-01-preview", - ) - - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_cassandra_clusters_begin_deallocate(self, resource_group): @@ -275,7 +192,7 @@ async def test_cassandra_clusters_begin_deallocate(self, resource_group): await self.client.cassandra_clusters.begin_deallocate( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -289,7 +206,7 @@ async def test_cassandra_clusters_begin_start(self, resource_group): await self.client.cassandra_clusters.begin_start( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -302,7 +219,7 @@ async def test_cassandra_clusters_status(self, resource_group): response = await self.client.cassandra_clusters.status( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_data_centers_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_data_centers_operations.py index 330875d726c9..ca7ce3103a7e 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_data_centers_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_data_centers_operations.py @@ -24,7 +24,7 @@ def test_cassandra_data_centers_list(self, resource_group): response = self.client.cassandra_data_centers.list( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_cassandra_data_centers_get(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", data_center_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -50,7 +50,7 @@ def test_cassandra_data_centers_begin_delete(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", data_center_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -95,7 +95,7 @@ def test_cassandra_data_centers_begin_create_update(self, resource_group): }, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -140,7 +140,7 @@ def test_cassandra_data_centers_begin_update(self, resource_group): }, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_data_centers_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_data_centers_operations_async.py index d1a3277e598f..59c26b127d36 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_data_centers_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_data_centers_operations_async.py @@ -25,7 +25,7 @@ async def test_cassandra_data_centers_list(self, resource_group): response = self.client.cassandra_data_centers.list( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_cassandra_data_centers_get(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", data_center_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -52,7 +52,7 @@ async def test_cassandra_data_centers_begin_delete(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", data_center_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -104,7 +104,7 @@ async def test_cassandra_data_centers_begin_create_update(self, resource_group): }, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -156,7 +156,7 @@ async def test_cassandra_data_centers_begin_update(self, resource_group): }, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_resources_operations.py index 865354b08f89..f7c65b4c8772 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_resources_operations.py @@ -24,7 +24,7 @@ def test_cassandra_resources_list_cassandra_keyspaces(self, resource_group): response = self.client.cassandra_resources.list_cassandra_keyspaces( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_cassandra_resources_get_cassandra_keyspace(self, resource_group): resource_group_name=resource_group.name, account_name="str", keyspace_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -53,19 +53,13 @@ def test_cassandra_resources_begin_create_update_cassandra_keyspace(self, resour create_update_cassandra_keyspace_parameters={ "resource": {"id": "str"}, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -78,7 +72,7 @@ def test_cassandra_resources_begin_delete_cassandra_keyspace(self, resource_grou resource_group_name=resource_group.name, account_name="str", keyspace_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -91,7 +85,7 @@ def test_cassandra_resources_get_cassandra_keyspace_throughput(self, resource_gr resource_group_name=resource_group.name, account_name="str", keyspace_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -116,21 +110,14 @@ def test_cassandra_resources_begin_update_cassandra_keyspace_throughput(self, re "offerReplacePending": "str", "softAllowedMaximumThroughput": "str", "throughput": 0, - "throughputBuckets": [{"id": 0, "maxThroughputPercentage": 0}], }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -143,7 +130,7 @@ def test_cassandra_resources_begin_migrate_cassandra_keyspace_to_autoscale(self, resource_group_name=resource_group.name, account_name="str", keyspace_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -156,7 +143,7 @@ def test_cassandra_resources_begin_migrate_cassandra_keyspace_to_manual_throughp resource_group_name=resource_group.name, account_name="str", keyspace_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -169,7 +156,7 @@ def test_cassandra_resources_list_cassandra_tables(self, resource_group): resource_group_name=resource_group.name, account_name="str", keyspace_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -183,7 +170,7 @@ def test_cassandra_resources_get_cassandra_table(self, resource_group): account_name="str", keyspace_name="str", table_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -209,19 +196,13 @@ def test_cassandra_resources_begin_create_update_cassandra_table(self, resource_ }, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -235,7 +216,7 @@ def test_cassandra_resources_begin_delete_cassandra_table(self, resource_group): account_name="str", keyspace_name="str", table_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -249,7 +230,7 @@ def test_cassandra_resources_get_cassandra_table_throughput(self, resource_group account_name="str", keyspace_name="str", table_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -275,21 +256,14 @@ def test_cassandra_resources_begin_update_cassandra_table_throughput(self, resou "offerReplacePending": "str", "softAllowedMaximumThroughput": "str", "throughput": 0, - "throughputBuckets": [{"id": 0, "maxThroughputPercentage": 0}], }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -303,7 +277,7 @@ def test_cassandra_resources_begin_migrate_cassandra_table_to_autoscale(self, re account_name="str", keyspace_name="str", table_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -317,159 +291,7 @@ def test_cassandra_resources_begin_migrate_cassandra_table_to_manual_throughput( account_name="str", keyspace_name="str", table_name="str", - api_version="2024-12-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_cassandra_resources_list_cassandra_views(self, resource_group): - response = self.client.cassandra_resources.list_cassandra_views( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - api_version="2024-12-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_cassandra_resources_get_cassandra_view(self, resource_group): - response = self.client.cassandra_resources.get_cassandra_view( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - api_version="2024-12-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_cassandra_resources_begin_create_update_cassandra_view(self, resource_group): - response = self.client.cassandra_resources.begin_create_update_cassandra_view( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - create_update_cassandra_view_parameters={ - "resource": {"id": "str", "viewDefinition": "str"}, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-12-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_cassandra_resources_begin_delete_cassandra_view(self, resource_group): - response = self.client.cassandra_resources.begin_delete_cassandra_view( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - api_version="2024-12-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_cassandra_resources_get_cassandra_view_throughput(self, resource_group): - response = self.client.cassandra_resources.get_cassandra_view_throughput( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - api_version="2024-12-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_cassandra_resources_begin_update_cassandra_view_throughput(self, resource_group): - response = self.client.cassandra_resources.begin_update_cassandra_view_throughput( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - update_throughput_parameters={ - "resource": { - "autoscaleSettings": { - "maxThroughput": 0, - "autoUpgradePolicy": {"throughputPolicy": {"incrementPercent": 0, "isEnabled": bool}}, - "targetMaxThroughput": 0, - }, - "instantMaximumThroughput": "str", - "minimumThroughput": "str", - "offerReplacePending": "str", - "softAllowedMaximumThroughput": "str", - "throughput": 0, - "throughputBuckets": [{"id": 0, "maxThroughputPercentage": 0}], - }, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-12-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_cassandra_resources_begin_migrate_cassandra_view_to_autoscale(self, resource_group): - response = self.client.cassandra_resources.begin_migrate_cassandra_view_to_autoscale( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - api_version="2024-12-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_cassandra_resources_begin_migrate_cassandra_view_to_manual_throughput(self, resource_group): - response = self.client.cassandra_resources.begin_migrate_cassandra_view_to_manual_throughput( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_resources_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_resources_operations_async.py index 80f4a0fe52ef..04e28dab9555 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_resources_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_resources_operations_async.py @@ -25,7 +25,7 @@ async def test_cassandra_resources_list_cassandra_keyspaces(self, resource_group response = self.client.cassandra_resources.list_cassandra_keyspaces( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_cassandra_resources_get_cassandra_keyspace(self, resource_group): resource_group_name=resource_group.name, account_name="str", keyspace_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -55,19 +55,13 @@ async def test_cassandra_resources_begin_create_update_cassandra_keyspace(self, create_update_cassandra_keyspace_parameters={ "resource": {"id": "str"}, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -82,7 +76,7 @@ async def test_cassandra_resources_begin_delete_cassandra_keyspace(self, resourc resource_group_name=resource_group.name, account_name="str", keyspace_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -96,7 +90,7 @@ async def test_cassandra_resources_get_cassandra_keyspace_throughput(self, resou resource_group_name=resource_group.name, account_name="str", keyspace_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -122,21 +116,14 @@ async def test_cassandra_resources_begin_update_cassandra_keyspace_throughput(se "offerReplacePending": "str", "softAllowedMaximumThroughput": "str", "throughput": 0, - "throughputBuckets": [{"id": 0, "maxThroughputPercentage": 0}], }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -151,7 +138,7 @@ async def test_cassandra_resources_begin_migrate_cassandra_keyspace_to_autoscale resource_group_name=resource_group.name, account_name="str", keyspace_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -166,7 +153,7 @@ async def test_cassandra_resources_begin_migrate_cassandra_keyspace_to_manual_th resource_group_name=resource_group.name, account_name="str", keyspace_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -180,7 +167,7 @@ async def test_cassandra_resources_list_cassandra_tables(self, resource_group): resource_group_name=resource_group.name, account_name="str", keyspace_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -194,7 +181,7 @@ async def test_cassandra_resources_get_cassandra_table(self, resource_group): account_name="str", keyspace_name="str", table_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -221,19 +208,13 @@ async def test_cassandra_resources_begin_create_update_cassandra_table(self, res }, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -249,7 +230,7 @@ async def test_cassandra_resources_begin_delete_cassandra_table(self, resource_g account_name="str", keyspace_name="str", table_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -264,7 +245,7 @@ async def test_cassandra_resources_get_cassandra_table_throughput(self, resource account_name="str", keyspace_name="str", table_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -291,21 +272,14 @@ async def test_cassandra_resources_begin_update_cassandra_table_throughput(self, "offerReplacePending": "str", "softAllowedMaximumThroughput": "str", "throughput": 0, - "throughputBuckets": [{"id": 0, "maxThroughputPercentage": 0}], }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -321,7 +295,7 @@ async def test_cassandra_resources_begin_migrate_cassandra_table_to_autoscale(se account_name="str", keyspace_name="str", table_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -337,169 +311,7 @@ async def test_cassandra_resources_begin_migrate_cassandra_table_to_manual_throu account_name="str", keyspace_name="str", table_name="str", - api_version="2024-12-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_cassandra_resources_list_cassandra_views(self, resource_group): - response = self.client.cassandra_resources.list_cassandra_views( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - api_version="2024-12-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_cassandra_resources_get_cassandra_view(self, resource_group): - response = await self.client.cassandra_resources.get_cassandra_view( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - api_version="2024-12-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_cassandra_resources_begin_create_update_cassandra_view(self, resource_group): - response = await ( - await self.client.cassandra_resources.begin_create_update_cassandra_view( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - create_update_cassandra_view_parameters={ - "resource": {"id": "str", "viewDefinition": "str"}, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-12-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_cassandra_resources_begin_delete_cassandra_view(self, resource_group): - response = await ( - await self.client.cassandra_resources.begin_delete_cassandra_view( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - api_version="2024-12-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_cassandra_resources_get_cassandra_view_throughput(self, resource_group): - response = await self.client.cassandra_resources.get_cassandra_view_throughput( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - api_version="2024-12-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_cassandra_resources_begin_update_cassandra_view_throughput(self, resource_group): - response = await ( - await self.client.cassandra_resources.begin_update_cassandra_view_throughput( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - update_throughput_parameters={ - "resource": { - "autoscaleSettings": { - "maxThroughput": 0, - "autoUpgradePolicy": {"throughputPolicy": {"incrementPercent": 0, "isEnabled": bool}}, - "targetMaxThroughput": 0, - }, - "instantMaximumThroughput": "str", - "minimumThroughput": "str", - "offerReplacePending": "str", - "softAllowedMaximumThroughput": "str", - "throughput": 0, - "throughputBuckets": [{"id": 0, "maxThroughputPercentage": 0}], - }, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-12-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_cassandra_resources_begin_migrate_cassandra_view_to_autoscale(self, resource_group): - response = await ( - await self.client.cassandra_resources.begin_migrate_cassandra_view_to_autoscale( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - api_version="2024-12-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_cassandra_resources_begin_migrate_cassandra_view_to_manual_throughput(self, resource_group): - response = await ( - await self.client.cassandra_resources.begin_migrate_cassandra_view_to_manual_throughput( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_operations.py index 6a6c9ff4b3b2..6137584c7ca3 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_operations.py @@ -27,7 +27,7 @@ def test_collection_list_metrics(self, resource_group): database_rid="str", collection_rid="str", filter="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,7 +41,7 @@ def test_collection_list_usages(self, resource_group): account_name="str", database_rid="str", collection_rid="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -55,7 +55,7 @@ def test_collection_list_metric_definitions(self, resource_group): account_name="str", database_rid="str", collection_rid="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_operations_async.py index 6a0404f21dfb..90148584f0dd 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_operations_async.py @@ -28,7 +28,7 @@ async def test_collection_list_metrics(self, resource_group): database_rid="str", collection_rid="str", filter="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -42,7 +42,7 @@ async def test_collection_list_usages(self, resource_group): account_name="str", database_rid="str", collection_rid="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -56,7 +56,7 @@ async def test_collection_list_metric_definitions(self, resource_group): account_name="str", database_rid="str", collection_rid="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_operations.py index e7602a86f2f6..c73ba1e27da9 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_operations.py @@ -27,7 +27,7 @@ def test_collection_partition_list_metrics(self, resource_group): database_rid="str", collection_rid="str", filter="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,7 +41,7 @@ def test_collection_partition_list_usages(self, resource_group): account_name="str", database_rid="str", collection_rid="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_operations_async.py index f2a09acc16cc..facd37209f66 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_operations_async.py @@ -28,7 +28,7 @@ async def test_collection_partition_list_metrics(self, resource_group): database_rid="str", collection_rid="str", filter="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -42,7 +42,7 @@ async def test_collection_partition_list_usages(self, resource_group): account_name="str", database_rid="str", collection_rid="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_region_operations.py index 6fa86fc36690..8e60a37d8386 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_region_operations.py @@ -28,7 +28,7 @@ def test_collection_partition_region_list_metrics(self, resource_group): database_rid="str", collection_rid="str", filter="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_region_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_region_operations_async.py index d5060c7d9624..889652bdb4da 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_region_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_region_operations_async.py @@ -29,7 +29,7 @@ async def test_collection_partition_region_list_metrics(self, resource_group): database_rid="str", collection_rid="str", filter="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_region_operations.py index fac97912af91..8a2d37620238 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_region_operations.py @@ -28,7 +28,7 @@ def test_collection_region_list_metrics(self, resource_group): database_rid="str", collection_rid="str", filter="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_region_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_region_operations_async.py index cb7aaffc0aa6..060e2ccb2db4 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_region_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_region_operations_async.py @@ -29,7 +29,7 @@ async def test_collection_region_list_metrics(self, resource_group): database_rid="str", collection_rid="str", filter="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_account_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_account_region_operations.py index 567878f3e9c2..8e3c6551462b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_account_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_account_region_operations.py @@ -26,7 +26,7 @@ def test_database_account_region_list_metrics(self, resource_group): account_name="str", region="str", filter="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_account_region_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_account_region_operations_async.py index d2d220283e65..7f28c2c6564d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_account_region_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_account_region_operations_async.py @@ -27,7 +27,7 @@ async def test_database_account_region_list_metrics(self, resource_group): account_name="str", region="str", filter="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_accounts_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_accounts_operations.py index 9393fcbaecc5..3b1e88ae251f 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_accounts_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_accounts_operations.py @@ -24,7 +24,7 @@ def test_database_accounts_get(self, resource_group): response = self.client.database_accounts.get( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -42,7 +42,6 @@ def test_database_accounts_begin_update(self, resource_group): "backupPolicy": "backup_policy", "capabilities": [{"name": "str"}], "capacity": {"totalThroughputLimit": 0}, - "capacityMode": "str", "connectorOffer": "str", "consistencyPolicy": { "defaultConsistencyLevel": "str", @@ -60,8 +59,6 @@ def test_database_accounts_begin_update(self, resource_group): ], "customerManagedKeyStatus": "str", "defaultIdentity": "str", - "defaultPriorityLevel": "str", - "diagnosticLogSettings": {"enableFullTextQuery": "str"}, "disableKeyBasedMetadataWriteAccess": bool, "disableLocalAuth": bool, "enableAnalyticalStorage": bool, @@ -69,11 +66,9 @@ def test_database_accounts_begin_update(self, resource_group): "enableBurstCapacity": bool, "enableCassandraConnector": bool, "enableFreeTier": bool, - "enableMaterializedViews": bool, "enableMultipleWriteLocations": bool, "enablePartitionMerge": bool, "enablePerRegionPerPartitionAutoscale": bool, - "enablePriorityBasedExecution": bool, "identity": { "principalId": "str", "tenantId": "str", @@ -107,7 +102,7 @@ def test_database_accounts_begin_update(self, resource_group): "tags": {"str": "str"}, "virtualNetworkRules": [{"id": "str", "ignoreMissingVNetServiceEndpoint": bool}], }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -136,7 +131,6 @@ def test_database_accounts_begin_create_or_update(self, resource_group): "backupPolicy": "backup_policy", "capabilities": [{"name": "str"}], "capacity": {"totalThroughputLimit": 0}, - "capacityMode": "str", "connectorOffer": "str", "consistencyPolicy": { "defaultConsistencyLevel": "str", @@ -155,8 +149,6 @@ def test_database_accounts_begin_create_or_update(self, resource_group): "createMode": "Default", "customerManagedKeyStatus": "str", "defaultIdentity": "str", - "defaultPriorityLevel": "str", - "diagnosticLogSettings": {"enableFullTextQuery": "str"}, "disableKeyBasedMetadataWriteAccess": bool, "disableLocalAuth": bool, "enableAnalyticalStorage": bool, @@ -164,11 +156,9 @@ def test_database_accounts_begin_create_or_update(self, resource_group): "enableBurstCapacity": bool, "enableCassandraConnector": bool, "enableFreeTier": bool, - "enableMaterializedViews": bool, "enableMultipleWriteLocations": bool, "enablePartitionMerge": bool, "enablePerRegionPerPartitionAutoscale": bool, - "enablePriorityBasedExecution": bool, "id": "str", "identity": { "principalId": "str", @@ -199,14 +189,13 @@ def test_database_accounts_begin_create_or_update(self, resource_group): "restoreSource": "str", "restoreTimestampInUtc": "2020-02-20 00:00:00", "restoreWithTtlDisabled": bool, - "sourceBackupLocation": "str", "tablesToRestore": ["str"], }, "tags": {"str": "str"}, "type": "str", "virtualNetworkRules": [{"id": "str", "ignoreMissingVNetServiceEndpoint": bool}], }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -218,7 +207,7 @@ def test_database_accounts_begin_delete(self, resource_group): response = self.client.database_accounts.begin_delete( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -231,7 +220,7 @@ def test_database_accounts_begin_failover_priority_change(self, resource_group): resource_group_name=resource_group.name, account_name="str", failover_parameters={"failoverPolicies": [{"failoverPriority": 0, "id": "str", "locationName": "str"}]}, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -241,7 +230,7 @@ def test_database_accounts_begin_failover_priority_change(self, resource_group): @recorded_by_proxy def test_database_accounts_list(self, resource_group): response = self.client.database_accounts.list( - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -252,7 +241,7 @@ def test_database_accounts_list(self, resource_group): def test_database_accounts_list_by_resource_group(self, resource_group): response = self.client.database_accounts.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -264,7 +253,7 @@ def test_database_accounts_list_keys(self, resource_group): response = self.client.database_accounts.list_keys( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -276,7 +265,7 @@ def test_database_accounts_list_connection_strings(self, resource_group): response = self.client.database_accounts.list_connection_strings( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -289,7 +278,7 @@ def test_database_accounts_begin_offline_region(self, resource_group): resource_group_name=resource_group.name, account_name="str", region_parameter_for_offline={"region": "str"}, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -302,7 +291,7 @@ def test_database_accounts_begin_online_region(self, resource_group): resource_group_name=resource_group.name, account_name="str", region_parameter_for_online={"region": "str"}, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -314,7 +303,7 @@ def test_database_accounts_get_read_only_keys(self, resource_group): response = self.client.database_accounts.get_read_only_keys( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -326,7 +315,7 @@ def test_database_accounts_list_read_only_keys(self, resource_group): response = self.client.database_accounts.list_read_only_keys( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -339,7 +328,7 @@ def test_database_accounts_begin_regenerate_key(self, resource_group): resource_group_name=resource_group.name, account_name="str", key_to_regenerate={"keyKind": "str"}, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -350,7 +339,7 @@ def test_database_accounts_begin_regenerate_key(self, resource_group): def test_database_accounts_check_name_exists(self, resource_group): response = self.client.database_accounts.check_name_exists( account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -363,7 +352,7 @@ def test_database_accounts_list_metrics(self, resource_group): resource_group_name=resource_group.name, account_name="str", filter="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -375,7 +364,7 @@ def test_database_accounts_list_usages(self, resource_group): response = self.client.database_accounts.list_usages( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -387,7 +376,7 @@ def test_database_accounts_list_metric_definitions(self, resource_group): response = self.client.database_accounts.list_metric_definitions( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_accounts_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_accounts_operations_async.py index 696502d7c76a..08836b912c9a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_accounts_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_accounts_operations_async.py @@ -25,7 +25,7 @@ async def test_database_accounts_get(self, resource_group): response = await self.client.database_accounts.get( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -44,7 +44,6 @@ async def test_database_accounts_begin_update(self, resource_group): "backupPolicy": "backup_policy", "capabilities": [{"name": "str"}], "capacity": {"totalThroughputLimit": 0}, - "capacityMode": "str", "connectorOffer": "str", "consistencyPolicy": { "defaultConsistencyLevel": "str", @@ -62,8 +61,6 @@ async def test_database_accounts_begin_update(self, resource_group): ], "customerManagedKeyStatus": "str", "defaultIdentity": "str", - "defaultPriorityLevel": "str", - "diagnosticLogSettings": {"enableFullTextQuery": "str"}, "disableKeyBasedMetadataWriteAccess": bool, "disableLocalAuth": bool, "enableAnalyticalStorage": bool, @@ -71,11 +68,9 @@ async def test_database_accounts_begin_update(self, resource_group): "enableBurstCapacity": bool, "enableCassandraConnector": bool, "enableFreeTier": bool, - "enableMaterializedViews": bool, "enableMultipleWriteLocations": bool, "enablePartitionMerge": bool, "enablePerRegionPerPartitionAutoscale": bool, - "enablePriorityBasedExecution": bool, "identity": { "principalId": "str", "tenantId": "str", @@ -109,7 +104,7 @@ async def test_database_accounts_begin_update(self, resource_group): "tags": {"str": "str"}, "virtualNetworkRules": [{"id": "str", "ignoreMissingVNetServiceEndpoint": bool}], }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -140,7 +135,6 @@ async def test_database_accounts_begin_create_or_update(self, resource_group): "backupPolicy": "backup_policy", "capabilities": [{"name": "str"}], "capacity": {"totalThroughputLimit": 0}, - "capacityMode": "str", "connectorOffer": "str", "consistencyPolicy": { "defaultConsistencyLevel": "str", @@ -159,8 +153,6 @@ async def test_database_accounts_begin_create_or_update(self, resource_group): "createMode": "Default", "customerManagedKeyStatus": "str", "defaultIdentity": "str", - "defaultPriorityLevel": "str", - "diagnosticLogSettings": {"enableFullTextQuery": "str"}, "disableKeyBasedMetadataWriteAccess": bool, "disableLocalAuth": bool, "enableAnalyticalStorage": bool, @@ -168,11 +160,9 @@ async def test_database_accounts_begin_create_or_update(self, resource_group): "enableBurstCapacity": bool, "enableCassandraConnector": bool, "enableFreeTier": bool, - "enableMaterializedViews": bool, "enableMultipleWriteLocations": bool, "enablePartitionMerge": bool, "enablePerRegionPerPartitionAutoscale": bool, - "enablePriorityBasedExecution": bool, "id": "str", "identity": { "principalId": "str", @@ -203,14 +193,13 @@ async def test_database_accounts_begin_create_or_update(self, resource_group): "restoreSource": "str", "restoreTimestampInUtc": "2020-02-20 00:00:00", "restoreWithTtlDisabled": bool, - "sourceBackupLocation": "str", "tablesToRestore": ["str"], }, "tags": {"str": "str"}, "type": "str", "virtualNetworkRules": [{"id": "str", "ignoreMissingVNetServiceEndpoint": bool}], }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -224,7 +213,7 @@ async def test_database_accounts_begin_delete(self, resource_group): await self.client.database_accounts.begin_delete( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -239,7 +228,7 @@ async def test_database_accounts_begin_failover_priority_change(self, resource_g resource_group_name=resource_group.name, account_name="str", failover_parameters={"failoverPolicies": [{"failoverPriority": 0, "id": "str", "locationName": "str"}]}, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -250,7 +239,7 @@ async def test_database_accounts_begin_failover_priority_change(self, resource_g @recorded_by_proxy_async async def test_database_accounts_list(self, resource_group): response = self.client.database_accounts.list( - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -261,7 +250,7 @@ async def test_database_accounts_list(self, resource_group): async def test_database_accounts_list_by_resource_group(self, resource_group): response = self.client.database_accounts.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -273,7 +262,7 @@ async def test_database_accounts_list_keys(self, resource_group): response = await self.client.database_accounts.list_keys( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -285,7 +274,7 @@ async def test_database_accounts_list_connection_strings(self, resource_group): response = await self.client.database_accounts.list_connection_strings( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -299,7 +288,7 @@ async def test_database_accounts_begin_offline_region(self, resource_group): resource_group_name=resource_group.name, account_name="str", region_parameter_for_offline={"region": "str"}, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -314,7 +303,7 @@ async def test_database_accounts_begin_online_region(self, resource_group): resource_group_name=resource_group.name, account_name="str", region_parameter_for_online={"region": "str"}, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -327,7 +316,7 @@ async def test_database_accounts_get_read_only_keys(self, resource_group): response = await self.client.database_accounts.get_read_only_keys( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -339,7 +328,7 @@ async def test_database_accounts_list_read_only_keys(self, resource_group): response = await self.client.database_accounts.list_read_only_keys( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -353,7 +342,7 @@ async def test_database_accounts_begin_regenerate_key(self, resource_group): resource_group_name=resource_group.name, account_name="str", key_to_regenerate={"keyKind": "str"}, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -365,7 +354,7 @@ async def test_database_accounts_begin_regenerate_key(self, resource_group): async def test_database_accounts_check_name_exists(self, resource_group): response = await self.client.database_accounts.check_name_exists( account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -378,7 +367,7 @@ async def test_database_accounts_list_metrics(self, resource_group): resource_group_name=resource_group.name, account_name="str", filter="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -390,7 +379,7 @@ async def test_database_accounts_list_usages(self, resource_group): response = self.client.database_accounts.list_usages( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -402,7 +391,7 @@ async def test_database_accounts_list_metric_definitions(self, resource_group): response = self.client.database_accounts.list_metric_definitions( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_operations.py index 1eed32c3501b..0fbd8434f6f2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_operations.py @@ -26,7 +26,7 @@ def test_database_list_metrics(self, resource_group): account_name="str", database_rid="str", filter="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -39,7 +39,7 @@ def test_database_list_usages(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_rid="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -52,7 +52,7 @@ def test_database_list_metric_definitions(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_rid="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_operations_async.py index c892c47af6f4..b86eb8d288d2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_operations_async.py @@ -27,7 +27,7 @@ async def test_database_list_metrics(self, resource_group): account_name="str", database_rid="str", filter="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -40,7 +40,7 @@ async def test_database_list_usages(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_rid="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -53,7 +53,7 @@ async def test_database_list_metric_definitions(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_rid="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_gremlin_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_gremlin_resources_operations.py index 631cc09e9387..30b6cd4d16a5 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_gremlin_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_gremlin_resources_operations.py @@ -24,7 +24,7 @@ def test_gremlin_resources_list_gremlin_databases(self, resource_group): response = self.client.gremlin_resources.list_gremlin_databases( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_gremlin_resources_get_gremlin_database(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -61,19 +61,13 @@ def test_gremlin_resources_begin_create_update_gremlin_database(self, resource_g }, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -86,7 +80,7 @@ def test_gremlin_resources_begin_delete_gremlin_database(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -99,7 +93,7 @@ def test_gremlin_resources_get_gremlin_database_throughput(self, resource_group) resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -124,21 +118,14 @@ def test_gremlin_resources_begin_update_gremlin_database_throughput(self, resour "offerReplacePending": "str", "softAllowedMaximumThroughput": "str", "throughput": 0, - "throughputBuckets": [{"id": 0, "maxThroughputPercentage": 0}], }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -151,7 +138,7 @@ def test_gremlin_resources_begin_migrate_gremlin_database_to_autoscale(self, res resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -164,7 +151,7 @@ def test_gremlin_resources_begin_migrate_gremlin_database_to_manual_throughput(s resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -177,7 +164,7 @@ def test_gremlin_resources_list_gremlin_graphs(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -191,7 +178,7 @@ def test_gremlin_resources_get_gremlin_graph(self, resource_group): account_name="str", database_name="str", graph_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -236,19 +223,13 @@ def test_gremlin_resources_begin_create_update_gremlin_graph(self, resource_grou "uniqueKeyPolicy": {"uniqueKeys": [{"paths": ["str"]}]}, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -262,7 +243,7 @@ def test_gremlin_resources_begin_delete_gremlin_graph(self, resource_group): account_name="str", database_name="str", graph_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -276,7 +257,7 @@ def test_gremlin_resources_get_gremlin_graph_throughput(self, resource_group): account_name="str", database_name="str", graph_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -302,21 +283,14 @@ def test_gremlin_resources_begin_update_gremlin_graph_throughput(self, resource_ "offerReplacePending": "str", "softAllowedMaximumThroughput": "str", "throughput": 0, - "throughputBuckets": [{"id": 0, "maxThroughputPercentage": 0}], }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -330,7 +304,7 @@ def test_gremlin_resources_begin_migrate_gremlin_graph_to_autoscale(self, resour account_name="str", database_name="str", graph_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -344,7 +318,7 @@ def test_gremlin_resources_begin_migrate_gremlin_graph_to_manual_throughput(self account_name="str", database_name="str", graph_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -359,7 +333,7 @@ def test_gremlin_resources_begin_retrieve_continuous_backup_information(self, re database_name="str", graph_name="str", location={"location": "str"}, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_gremlin_resources_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_gremlin_resources_operations_async.py index 43f593abaeb6..fb79666b78a9 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_gremlin_resources_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_gremlin_resources_operations_async.py @@ -25,7 +25,7 @@ async def test_gremlin_resources_list_gremlin_databases(self, resource_group): response = self.client.gremlin_resources.list_gremlin_databases( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_gremlin_resources_get_gremlin_database(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -63,19 +63,13 @@ async def test_gremlin_resources_begin_create_update_gremlin_database(self, reso }, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -90,7 +84,7 @@ async def test_gremlin_resources_begin_delete_gremlin_database(self, resource_gr resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -104,7 +98,7 @@ async def test_gremlin_resources_get_gremlin_database_throughput(self, resource_ resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -130,21 +124,14 @@ async def test_gremlin_resources_begin_update_gremlin_database_throughput(self, "offerReplacePending": "str", "softAllowedMaximumThroughput": "str", "throughput": 0, - "throughputBuckets": [{"id": 0, "maxThroughputPercentage": 0}], }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -159,7 +146,7 @@ async def test_gremlin_resources_begin_migrate_gremlin_database_to_autoscale(sel resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -174,7 +161,7 @@ async def test_gremlin_resources_begin_migrate_gremlin_database_to_manual_throug resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -188,7 +175,7 @@ async def test_gremlin_resources_list_gremlin_graphs(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -202,7 +189,7 @@ async def test_gremlin_resources_get_gremlin_graph(self, resource_group): account_name="str", database_name="str", graph_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -248,19 +235,13 @@ async def test_gremlin_resources_begin_create_update_gremlin_graph(self, resourc "uniqueKeyPolicy": {"uniqueKeys": [{"paths": ["str"]}]}, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -276,7 +257,7 @@ async def test_gremlin_resources_begin_delete_gremlin_graph(self, resource_group account_name="str", database_name="str", graph_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -291,7 +272,7 @@ async def test_gremlin_resources_get_gremlin_graph_throughput(self, resource_gro account_name="str", database_name="str", graph_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -318,21 +299,14 @@ async def test_gremlin_resources_begin_update_gremlin_graph_throughput(self, res "offerReplacePending": "str", "softAllowedMaximumThroughput": "str", "throughput": 0, - "throughputBuckets": [{"id": 0, "maxThroughputPercentage": 0}], }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -348,7 +322,7 @@ async def test_gremlin_resources_begin_migrate_gremlin_graph_to_autoscale(self, account_name="str", database_name="str", graph_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -364,7 +338,7 @@ async def test_gremlin_resources_begin_migrate_gremlin_graph_to_manual_throughpu account_name="str", database_name="str", graph_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -381,7 +355,7 @@ async def test_gremlin_resources_begin_retrieve_continuous_backup_information(se database_name="str", graph_name="str", location={"location": "str"}, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_locations_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_locations_operations.py index 5cb97b7d64af..46c33664b609 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_locations_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_locations_operations.py @@ -22,7 +22,7 @@ def setup_method(self, method): @recorded_by_proxy def test_locations_list(self, resource_group): response = self.client.locations.list( - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -33,7 +33,7 @@ def test_locations_list(self, resource_group): def test_locations_get(self, resource_group): response = self.client.locations.get( location="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_locations_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_locations_operations_async.py index 6b76bba49255..f69fb69e5687 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_locations_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_locations_operations_async.py @@ -23,7 +23,7 @@ def setup_method(self, method): @recorded_by_proxy_async async def test_locations_list(self, resource_group): response = self.client.locations.list( - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -34,7 +34,7 @@ async def test_locations_list(self, resource_group): async def test_locations_get(self, resource_group): response = await self.client.locations.get( location="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_mongo_db_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_mongo_db_resources_operations.py index 72baf8ed5d3d..a59ae419b0fd 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_mongo_db_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_mongo_db_resources_operations.py @@ -24,7 +24,7 @@ def test_mongo_db_resources_list_mongo_db_databases(self, resource_group): response = self.client.mongo_db_resources.list_mongo_db_databases( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_mongo_db_resources_get_mongo_db_database(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -61,19 +61,13 @@ def test_mongo_db_resources_begin_create_update_mongo_db_database(self, resource }, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -86,7 +80,7 @@ def test_mongo_db_resources_begin_delete_mongo_db_database(self, resource_group) resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -99,7 +93,7 @@ def test_mongo_db_resources_get_mongo_db_database_throughput(self, resource_grou resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -124,21 +118,14 @@ def test_mongo_db_resources_begin_update_mongo_db_database_throughput(self, reso "offerReplacePending": "str", "softAllowedMaximumThroughput": "str", "throughput": 0, - "throughputBuckets": [{"id": 0, "maxThroughputPercentage": 0}], }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -151,7 +138,7 @@ def test_mongo_db_resources_begin_migrate_mongo_db_database_to_autoscale(self, r resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -164,125 +151,7 @@ def test_mongo_db_resources_begin_migrate_mongo_db_database_to_manual_throughput resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_mongo_db_resources_begin_mongo_db_database_retrieve_throughput_distribution(self, resource_group): - response = self.client.mongo_db_resources.begin_mongo_db_database_retrieve_throughput_distribution( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - retrieve_throughput_parameters={ - "resource": {"physicalPartitionIds": [{"id": "str"}]}, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-12-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_mongo_db_resources_begin_mongo_db_database_redistribute_throughput(self, resource_group): - response = self.client.mongo_db_resources.begin_mongo_db_database_redistribute_throughput( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - redistribute_throughput_parameters={ - "resource": { - "sourcePhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "targetPhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "throughputPolicy": "str", - }, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-12-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_mongo_db_resources_begin_mongo_db_container_retrieve_throughput_distribution(self, resource_group): - response = self.client.mongo_db_resources.begin_mongo_db_container_retrieve_throughput_distribution( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - collection_name="str", - retrieve_throughput_parameters={ - "resource": {"physicalPartitionIds": [{"id": "str"}]}, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-12-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_mongo_db_resources_begin_mongo_db_container_redistribute_throughput(self, resource_group): - response = self.client.mongo_db_resources.begin_mongo_db_container_redistribute_throughput( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - collection_name="str", - redistribute_throughput_parameters={ - "resource": { - "sourcePhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "targetPhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "throughputPolicy": "str", - }, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -295,7 +164,7 @@ def test_mongo_db_resources_list_mongo_db_collections(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -309,7 +178,7 @@ def test_mongo_db_resources_get_mongo_db_collection(self, resource_group): account_name="str", database_name="str", collection_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -337,19 +206,13 @@ def test_mongo_db_resources_begin_create_update_mongo_db_collection(self, resour "shardKey": {"str": "str"}, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -363,36 +226,7 @@ def test_mongo_db_resources_begin_delete_mongo_db_collection(self, resource_grou account_name="str", database_name="str", collection_name="str", - api_version="2024-12-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_mongo_db_resources_begin_mongo_db_database_partition_merge(self, resource_group): - response = self.client.mongo_db_resources.begin_mongo_db_database_partition_merge( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - merge_parameters={"isDryRun": bool}, - api_version="2024-12-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_mongo_db_resources_begin_list_mongo_db_collection_partition_merge(self, resource_group): - response = self.client.mongo_db_resources.begin_list_mongo_db_collection_partition_merge( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - collection_name="str", - merge_parameters={"isDryRun": bool}, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -406,7 +240,7 @@ def test_mongo_db_resources_get_mongo_db_collection_throughput(self, resource_gr account_name="str", database_name="str", collection_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -432,21 +266,14 @@ def test_mongo_db_resources_begin_update_mongo_db_collection_throughput(self, re "offerReplacePending": "str", "softAllowedMaximumThroughput": "str", "throughput": 0, - "throughputBuckets": [{"id": 0, "maxThroughputPercentage": 0}], }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -460,7 +287,7 @@ def test_mongo_db_resources_begin_migrate_mongo_db_collection_to_autoscale(self, account_name="str", database_name="str", collection_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -474,7 +301,7 @@ def test_mongo_db_resources_begin_migrate_mongo_db_collection_to_manual_throughp account_name="str", database_name="str", collection_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -487,7 +314,7 @@ def test_mongo_db_resources_get_mongo_role_definition(self, resource_group): mongo_role_definition_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -507,7 +334,7 @@ def test_mongo_db_resources_begin_create_update_mongo_role_definition(self, reso "roles": [{"db": "str", "role": "str"}], "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -520,7 +347,7 @@ def test_mongo_db_resources_begin_delete_mongo_role_definition(self, resource_gr mongo_role_definition_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -532,7 +359,7 @@ def test_mongo_db_resources_list_mongo_role_definitions(self, resource_group): response = self.client.mongo_db_resources.list_mongo_role_definitions( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -545,7 +372,7 @@ def test_mongo_db_resources_get_mongo_user_definition(self, resource_group): mongo_user_definition_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -566,7 +393,7 @@ def test_mongo_db_resources_begin_create_update_mongo_user_definition(self, reso "roles": [{"db": "str", "role": "str"}], "userName": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -579,7 +406,7 @@ def test_mongo_db_resources_begin_delete_mongo_user_definition(self, resource_gr mongo_user_definition_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -591,7 +418,7 @@ def test_mongo_db_resources_list_mongo_user_definitions(self, resource_group): response = self.client.mongo_db_resources.list_mongo_user_definitions( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -606,7 +433,7 @@ def test_mongo_db_resources_begin_retrieve_continuous_backup_information(self, r database_name="str", collection_name="str", location={"location": "str"}, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_mongo_db_resources_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_mongo_db_resources_operations_async.py index 0cea589b6a70..12439feb98b3 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_mongo_db_resources_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_mongo_db_resources_operations_async.py @@ -25,7 +25,7 @@ async def test_mongo_db_resources_list_mongo_db_databases(self, resource_group): response = self.client.mongo_db_resources.list_mongo_db_databases( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_mongo_db_resources_get_mongo_db_database(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -63,19 +63,13 @@ async def test_mongo_db_resources_begin_create_update_mongo_db_database(self, re }, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -90,7 +84,7 @@ async def test_mongo_db_resources_begin_delete_mongo_db_database(self, resource_ resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -104,7 +98,7 @@ async def test_mongo_db_resources_get_mongo_db_database_throughput(self, resourc resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -130,21 +124,14 @@ async def test_mongo_db_resources_begin_update_mongo_db_database_throughput(self "offerReplacePending": "str", "softAllowedMaximumThroughput": "str", "throughput": 0, - "throughputBuckets": [{"id": 0, "maxThroughputPercentage": 0}], }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -159,7 +146,7 @@ async def test_mongo_db_resources_begin_migrate_mongo_db_database_to_autoscale(s resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -174,133 +161,7 @@ async def test_mongo_db_resources_begin_migrate_mongo_db_database_to_manual_thro resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_mongo_db_resources_begin_mongo_db_database_retrieve_throughput_distribution(self, resource_group): - response = await ( - await self.client.mongo_db_resources.begin_mongo_db_database_retrieve_throughput_distribution( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - retrieve_throughput_parameters={ - "resource": {"physicalPartitionIds": [{"id": "str"}]}, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-12-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_mongo_db_resources_begin_mongo_db_database_redistribute_throughput(self, resource_group): - response = await ( - await self.client.mongo_db_resources.begin_mongo_db_database_redistribute_throughput( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - redistribute_throughput_parameters={ - "resource": { - "sourcePhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "targetPhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "throughputPolicy": "str", - }, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-12-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_mongo_db_resources_begin_mongo_db_container_retrieve_throughput_distribution(self, resource_group): - response = await ( - await self.client.mongo_db_resources.begin_mongo_db_container_retrieve_throughput_distribution( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - collection_name="str", - retrieve_throughput_parameters={ - "resource": {"physicalPartitionIds": [{"id": "str"}]}, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-12-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_mongo_db_resources_begin_mongo_db_container_redistribute_throughput(self, resource_group): - response = await ( - await self.client.mongo_db_resources.begin_mongo_db_container_redistribute_throughput( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - collection_name="str", - redistribute_throughput_parameters={ - "resource": { - "sourcePhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "targetPhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "throughputPolicy": "str", - }, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -314,7 +175,7 @@ async def test_mongo_db_resources_list_mongo_db_collections(self, resource_group resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -328,7 +189,7 @@ async def test_mongo_db_resources_get_mongo_db_collection(self, resource_group): account_name="str", database_name="str", collection_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -357,19 +218,13 @@ async def test_mongo_db_resources_begin_create_update_mongo_db_collection(self, "shardKey": {"str": "str"}, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -385,40 +240,7 @@ async def test_mongo_db_resources_begin_delete_mongo_db_collection(self, resourc account_name="str", database_name="str", collection_name="str", - api_version="2024-12-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_mongo_db_resources_begin_mongo_db_database_partition_merge(self, resource_group): - response = await ( - await self.client.mongo_db_resources.begin_mongo_db_database_partition_merge( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - merge_parameters={"isDryRun": bool}, - api_version="2024-12-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_mongo_db_resources_begin_list_mongo_db_collection_partition_merge(self, resource_group): - response = await ( - await self.client.mongo_db_resources.begin_list_mongo_db_collection_partition_merge( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - collection_name="str", - merge_parameters={"isDryRun": bool}, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -433,7 +255,7 @@ async def test_mongo_db_resources_get_mongo_db_collection_throughput(self, resou account_name="str", database_name="str", collection_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -460,21 +282,14 @@ async def test_mongo_db_resources_begin_update_mongo_db_collection_throughput(se "offerReplacePending": "str", "softAllowedMaximumThroughput": "str", "throughput": 0, - "throughputBuckets": [{"id": 0, "maxThroughputPercentage": 0}], }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -490,7 +305,7 @@ async def test_mongo_db_resources_begin_migrate_mongo_db_collection_to_autoscale account_name="str", database_name="str", collection_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -506,7 +321,7 @@ async def test_mongo_db_resources_begin_migrate_mongo_db_collection_to_manual_th account_name="str", database_name="str", collection_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -520,7 +335,7 @@ async def test_mongo_db_resources_get_mongo_role_definition(self, resource_group mongo_role_definition_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -541,7 +356,7 @@ async def test_mongo_db_resources_begin_create_update_mongo_role_definition(self "roles": [{"db": "str", "role": "str"}], "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -556,7 +371,7 @@ async def test_mongo_db_resources_begin_delete_mongo_role_definition(self, resou mongo_role_definition_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -569,7 +384,7 @@ async def test_mongo_db_resources_list_mongo_role_definitions(self, resource_gro response = self.client.mongo_db_resources.list_mongo_role_definitions( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -582,7 +397,7 @@ async def test_mongo_db_resources_get_mongo_user_definition(self, resource_group mongo_user_definition_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -604,7 +419,7 @@ async def test_mongo_db_resources_begin_create_update_mongo_user_definition(self "roles": [{"db": "str", "role": "str"}], "userName": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -619,7 +434,7 @@ async def test_mongo_db_resources_begin_delete_mongo_user_definition(self, resou mongo_user_definition_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -632,7 +447,7 @@ async def test_mongo_db_resources_list_mongo_user_definitions(self, resource_gro response = self.client.mongo_db_resources.list_mongo_user_definitions( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -648,7 +463,7 @@ async def test_mongo_db_resources_begin_retrieve_continuous_backup_information(s database_name="str", collection_name="str", location={"location": "str"}, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_notebook_workspaces_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_notebook_workspaces_operations.py index b3a87cbfb23b..d24edcbf4422 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_notebook_workspaces_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_notebook_workspaces_operations.py @@ -24,7 +24,7 @@ def test_notebook_workspaces_list_by_database_account(self, resource_group): response = self.client.notebook_workspaces.list_by_database_account( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_notebook_workspaces_get(self, resource_group): resource_group_name=resource_group.name, account_name="str", notebook_workspace_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -51,7 +51,7 @@ def test_notebook_workspaces_begin_create_or_update(self, resource_group): account_name="str", notebook_workspace_name="str", notebook_create_update_parameters={"id": "str", "name": "str", "type": "str"}, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -64,7 +64,7 @@ def test_notebook_workspaces_begin_delete(self, resource_group): resource_group_name=resource_group.name, account_name="str", notebook_workspace_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -77,7 +77,7 @@ def test_notebook_workspaces_list_connection_info(self, resource_group): resource_group_name=resource_group.name, account_name="str", notebook_workspace_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -90,7 +90,7 @@ def test_notebook_workspaces_begin_regenerate_auth_token(self, resource_group): resource_group_name=resource_group.name, account_name="str", notebook_workspace_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -103,7 +103,7 @@ def test_notebook_workspaces_begin_start(self, resource_group): resource_group_name=resource_group.name, account_name="str", notebook_workspace_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_notebook_workspaces_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_notebook_workspaces_operations_async.py index b9156bfbb2a3..c2fd50650e57 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_notebook_workspaces_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_notebook_workspaces_operations_async.py @@ -25,7 +25,7 @@ async def test_notebook_workspaces_list_by_database_account(self, resource_group response = self.client.notebook_workspaces.list_by_database_account( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_notebook_workspaces_get(self, resource_group): resource_group_name=resource_group.name, account_name="str", notebook_workspace_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -53,7 +53,7 @@ async def test_notebook_workspaces_begin_create_or_update(self, resource_group): account_name="str", notebook_workspace_name="str", notebook_create_update_parameters={"id": "str", "name": "str", "type": "str"}, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -68,7 +68,7 @@ async def test_notebook_workspaces_begin_delete(self, resource_group): resource_group_name=resource_group.name, account_name="str", notebook_workspace_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -82,7 +82,7 @@ async def test_notebook_workspaces_list_connection_info(self, resource_group): resource_group_name=resource_group.name, account_name="str", notebook_workspace_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -96,7 +96,7 @@ async def test_notebook_workspaces_begin_regenerate_auth_token(self, resource_gr resource_group_name=resource_group.name, account_name="str", notebook_workspace_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -111,7 +111,7 @@ async def test_notebook_workspaces_begin_start(self, resource_group): resource_group_name=resource_group.name, account_name="str", notebook_workspace_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_operations.py index 363b3e07d527..5f0f812c8f3d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_operations.py @@ -22,7 +22,7 @@ def setup_method(self, method): @recorded_by_proxy def test_operations_list(self, resource_group): response = self.client.operations.list( - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_operations_async.py index bd0894193196..8e865cc5a7fa 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_operations_async.py @@ -23,7 +23,7 @@ def setup_method(self, method): @recorded_by_proxy_async async def test_operations_list(self, resource_group): response = self.client.operations.list( - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_operations.py index 8c3b88505f44..150ce1d3a4f2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_operations.py @@ -28,7 +28,7 @@ def test_partition_key_range_id_list_metrics(self, resource_group): collection_rid="str", partition_key_range_id="str", filter="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_operations_async.py index 3f18ca68819c..3f5577bd6956 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_operations_async.py @@ -29,7 +29,7 @@ async def test_partition_key_range_id_list_metrics(self, resource_group): collection_rid="str", partition_key_range_id="str", filter="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_region_operations.py index 9d405c67f1ae..e5330e8b2c72 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_region_operations.py @@ -29,7 +29,7 @@ def test_partition_key_range_id_region_list_metrics(self, resource_group): collection_rid="str", partition_key_range_id="str", filter="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_region_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_region_operations_async.py index 07ceee0ae667..df3405f0f0dc 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_region_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_region_operations_async.py @@ -30,7 +30,7 @@ async def test_partition_key_range_id_region_list_metrics(self, resource_group): collection_rid="str", partition_key_range_id="str", filter="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_operations.py index 02879fa3891d..4079ce390ef2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_operations.py @@ -25,7 +25,7 @@ def test_percentile_list_metrics(self, resource_group): resource_group_name=resource_group.name, account_name="str", filter="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_operations_async.py index 8e1fab53b1ff..d7910a11144c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_operations_async.py @@ -26,7 +26,7 @@ async def test_percentile_list_metrics(self, resource_group): resource_group_name=resource_group.name, account_name="str", filter="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_source_target_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_source_target_operations.py index 4508234b89d3..df4aa6973b63 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_source_target_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_source_target_operations.py @@ -27,7 +27,7 @@ def test_percentile_source_target_list_metrics(self, resource_group): source_region="str", target_region="str", filter="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_source_target_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_source_target_operations_async.py index eef9986f0bc8..3027aa29702a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_source_target_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_source_target_operations_async.py @@ -28,7 +28,7 @@ async def test_percentile_source_target_list_metrics(self, resource_group): source_region="str", target_region="str", filter="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_target_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_target_operations.py index d3c794d36f5d..ecfa9380edee 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_target_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_target_operations.py @@ -26,7 +26,7 @@ def test_percentile_target_list_metrics(self, resource_group): account_name="str", target_region="str", filter="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_target_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_target_operations_async.py index 14a676974ff1..ae365ca799be 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_target_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_target_operations_async.py @@ -27,7 +27,7 @@ async def test_percentile_target_list_metrics(self, resource_group): account_name="str", target_region="str", filter="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_endpoint_connections_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_endpoint_connections_operations.py index e2eb5e42329c..5545c04ff8f8 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_endpoint_connections_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_endpoint_connections_operations.py @@ -24,7 +24,7 @@ def test_private_endpoint_connections_list_by_database_account(self, resource_gr response = self.client.private_endpoint_connections.list_by_database_account( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_private_endpoint_connections_get(self, resource_group): resource_group_name=resource_group.name, account_name="str", private_endpoint_connection_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -57,17 +57,9 @@ def test_private_endpoint_connections_begin_create_or_update(self, resource_grou "privateEndpoint": {"id": "str"}, "privateLinkServiceConnectionState": {"actionsRequired": "str", "description": "str", "status": "str"}, "provisioningState": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -80,7 +72,7 @@ def test_private_endpoint_connections_begin_delete(self, resource_group): resource_group_name=resource_group.name, account_name="str", private_endpoint_connection_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_endpoint_connections_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_endpoint_connections_operations_async.py index 7182b0c2d9fa..ee0d3f3ef6b9 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_endpoint_connections_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_endpoint_connections_operations_async.py @@ -25,7 +25,7 @@ async def test_private_endpoint_connections_list_by_database_account(self, resou response = self.client.private_endpoint_connections.list_by_database_account( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_private_endpoint_connections_get(self, resource_group): resource_group_name=resource_group.name, account_name="str", private_endpoint_connection_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -63,17 +63,9 @@ async def test_private_endpoint_connections_begin_create_or_update(self, resourc "status": "str", }, "provisioningState": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -88,7 +80,7 @@ async def test_private_endpoint_connections_begin_delete(self, resource_group): resource_group_name=resource_group.name, account_name="str", private_endpoint_connection_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_link_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_link_resources_operations.py index 45912ca5876e..b8901b0f7430 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_link_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_link_resources_operations.py @@ -24,7 +24,7 @@ def test_private_link_resources_list_by_database_account(self, resource_group): response = self.client.private_link_resources.list_by_database_account( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_private_link_resources_get(self, resource_group): resource_group_name=resource_group.name, account_name="str", group_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_link_resources_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_link_resources_operations_async.py index 0b790c70a44e..9948ee0f72a1 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_link_resources_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_link_resources_operations_async.py @@ -25,7 +25,7 @@ async def test_private_link_resources_list_by_database_account(self, resource_gr response = self.client.private_link_resources.list_by_database_account( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_private_link_resources_get(self, resource_group): resource_group_name=resource_group.name, account_name="str", group_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_database_accounts_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_database_accounts_operations.py index e4f28c3cb1fb..6f7d9fdda680 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_database_accounts_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_database_accounts_operations.py @@ -23,7 +23,7 @@ def setup_method(self, method): def test_restorable_database_accounts_list_by_location(self, resource_group): response = self.client.restorable_database_accounts.list_by_location( location="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -33,7 +33,7 @@ def test_restorable_database_accounts_list_by_location(self, resource_group): @recorded_by_proxy def test_restorable_database_accounts_list(self, resource_group): response = self.client.restorable_database_accounts.list( - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_restorable_database_accounts_get_by_location(self, resource_group): response = self.client.restorable_database_accounts.get_by_location( location="str", instance_id="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_database_accounts_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_database_accounts_operations_async.py index d26d9e24c8e1..da33ed5a1917 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_database_accounts_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_database_accounts_operations_async.py @@ -24,7 +24,7 @@ def setup_method(self, method): async def test_restorable_database_accounts_list_by_location(self, resource_group): response = self.client.restorable_database_accounts.list_by_location( location="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -34,7 +34,7 @@ async def test_restorable_database_accounts_list_by_location(self, resource_grou @recorded_by_proxy_async async def test_restorable_database_accounts_list(self, resource_group): response = self.client.restorable_database_accounts.list( - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_restorable_database_accounts_get_by_location(self, resource_group response = await self.client.restorable_database_accounts.get_by_location( location="str", instance_id="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_databases_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_databases_operations.py index 5290e335f70c..7f9e7f35df08 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_databases_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_databases_operations.py @@ -24,7 +24,7 @@ def test_restorable_gremlin_databases_list(self, resource_group): response = self.client.restorable_gremlin_databases.list( location="str", instance_id="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_databases_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_databases_operations_async.py index 467c8788c182..f69fa23f318a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_databases_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_databases_operations_async.py @@ -25,7 +25,7 @@ async def test_restorable_gremlin_databases_list(self, resource_group): response = self.client.restorable_gremlin_databases.list( location="str", instance_id="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_graphs_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_graphs_operations.py index 12fce510beae..3ca35a76a693 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_graphs_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_graphs_operations.py @@ -24,7 +24,7 @@ def test_restorable_gremlin_graphs_list(self, resource_group): response = self.client.restorable_gremlin_graphs.list( location="str", instance_id="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_graphs_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_graphs_operations_async.py index 2c3190b0b779..49d3914f14c3 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_graphs_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_graphs_operations_async.py @@ -25,7 +25,7 @@ async def test_restorable_gremlin_graphs_list(self, resource_group): response = self.client.restorable_gremlin_graphs.list( location="str", instance_id="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_resources_operations.py index 55110a1fd8b8..939c447ba322 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_resources_operations.py @@ -24,7 +24,7 @@ def test_restorable_gremlin_resources_list(self, resource_group): response = self.client.restorable_gremlin_resources.list( location="str", instance_id="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_resources_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_resources_operations_async.py index fe862175aa7c..f1622bde6eb2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_resources_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_resources_operations_async.py @@ -25,7 +25,7 @@ async def test_restorable_gremlin_resources_list(self, resource_group): response = self.client.restorable_gremlin_resources.list( location="str", instance_id="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_collections_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_collections_operations.py index 9c696b3cae2b..d289347a8e02 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_collections_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_collections_operations.py @@ -24,7 +24,7 @@ def test_restorable_mongodb_collections_list(self, resource_group): response = self.client.restorable_mongodb_collections.list( location="str", instance_id="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_collections_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_collections_operations_async.py index a7c7c9a12e31..5c946b8ea04a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_collections_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_collections_operations_async.py @@ -25,7 +25,7 @@ async def test_restorable_mongodb_collections_list(self, resource_group): response = self.client.restorable_mongodb_collections.list( location="str", instance_id="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_databases_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_databases_operations.py index 7ea2d2cf5708..29c2a7b0425d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_databases_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_databases_operations.py @@ -24,7 +24,7 @@ def test_restorable_mongodb_databases_list(self, resource_group): response = self.client.restorable_mongodb_databases.list( location="str", instance_id="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_databases_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_databases_operations_async.py index 4ee2f741f503..131620edcb9e 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_databases_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_databases_operations_async.py @@ -25,7 +25,7 @@ async def test_restorable_mongodb_databases_list(self, resource_group): response = self.client.restorable_mongodb_databases.list( location="str", instance_id="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_resources_operations.py index d07c3de80a03..94268ac5c0a4 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_resources_operations.py @@ -24,7 +24,7 @@ def test_restorable_mongodb_resources_list(self, resource_group): response = self.client.restorable_mongodb_resources.list( location="str", instance_id="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_resources_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_resources_operations_async.py index 9ac06361e857..cc34f6b88790 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_resources_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_resources_operations_async.py @@ -25,7 +25,7 @@ async def test_restorable_mongodb_resources_list(self, resource_group): response = self.client.restorable_mongodb_resources.list( location="str", instance_id="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_containers_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_containers_operations.py index 4e9ceb6b5d04..6a8e19c0dce5 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_containers_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_containers_operations.py @@ -24,7 +24,7 @@ def test_restorable_sql_containers_list(self, resource_group): response = self.client.restorable_sql_containers.list( location="str", instance_id="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_containers_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_containers_operations_async.py index 96c04670cc85..0054fa8580ad 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_containers_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_containers_operations_async.py @@ -25,7 +25,7 @@ async def test_restorable_sql_containers_list(self, resource_group): response = self.client.restorable_sql_containers.list( location="str", instance_id="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_databases_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_databases_operations.py index 79dc5b6921dc..8cbe807ee33b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_databases_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_databases_operations.py @@ -24,7 +24,7 @@ def test_restorable_sql_databases_list(self, resource_group): response = self.client.restorable_sql_databases.list( location="str", instance_id="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_databases_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_databases_operations_async.py index aa1baa626414..3ee5e96dad8b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_databases_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_databases_operations_async.py @@ -25,7 +25,7 @@ async def test_restorable_sql_databases_list(self, resource_group): response = self.client.restorable_sql_databases.list( location="str", instance_id="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_resources_operations.py index 46040b9fca9e..d96b0314f087 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_resources_operations.py @@ -24,7 +24,7 @@ def test_restorable_sql_resources_list(self, resource_group): response = self.client.restorable_sql_resources.list( location="str", instance_id="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_resources_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_resources_operations_async.py index 8a5e44c8178f..985bf54276c4 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_resources_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_resources_operations_async.py @@ -25,7 +25,7 @@ async def test_restorable_sql_resources_list(self, resource_group): response = self.client.restorable_sql_resources.list( location="str", instance_id="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_table_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_table_resources_operations.py index c245ad711bf2..f988b7025141 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_table_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_table_resources_operations.py @@ -24,7 +24,7 @@ def test_restorable_table_resources_list(self, resource_group): response = self.client.restorable_table_resources.list( location="str", instance_id="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_table_resources_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_table_resources_operations_async.py index 25cdc0813a74..fd2683bab464 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_table_resources_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_table_resources_operations_async.py @@ -25,7 +25,7 @@ async def test_restorable_table_resources_list(self, resource_group): response = self.client.restorable_table_resources.list( location="str", instance_id="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_tables_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_tables_operations.py index 1701308013ec..dc8673686055 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_tables_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_tables_operations.py @@ -24,7 +24,7 @@ def test_restorable_tables_list(self, resource_group): response = self.client.restorable_tables.list( location="str", instance_id="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_tables_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_tables_operations_async.py index e70ac5568888..7f466e7a2c5f 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_tables_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_tables_operations_async.py @@ -25,7 +25,7 @@ async def test_restorable_tables_list(self, resource_group): response = self.client.restorable_tables.list( location="str", instance_id="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_service_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_service_operations.py index 0fc86f80fa8e..3d3f319eab90 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_service_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_service_operations.py @@ -24,7 +24,7 @@ def test_service_list(self, resource_group): response = self.client.service.list( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ def test_service_begin_create(self, resource_group): account_name="str", service_name="str", create_update_parameters={"properties": "service_resource_create_update_properties"}, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -51,7 +51,7 @@ def test_service_get(self, resource_group): resource_group_name=resource_group.name, account_name="str", service_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -64,7 +64,7 @@ def test_service_begin_delete(self, resource_group): resource_group_name=resource_group.name, account_name="str", service_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_service_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_service_operations_async.py index fde5ecb6faa6..83625cfd97d2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_service_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_service_operations_async.py @@ -25,7 +25,7 @@ async def test_service_list(self, resource_group): response = self.client.service.list( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -40,7 +40,7 @@ async def test_service_begin_create(self, resource_group): account_name="str", service_name="str", create_update_parameters={"properties": "service_resource_create_update_properties"}, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -54,7 +54,7 @@ async def test_service_get(self, resource_group): resource_group_name=resource_group.name, account_name="str", service_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -68,7 +68,7 @@ async def test_service_begin_delete(self, resource_group): resource_group_name=resource_group.name, account_name="str", service_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_sql_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_sql_resources_operations.py index 7488e7904d72..16f01eff3577 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_sql_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_sql_resources_operations.py @@ -24,7 +24,7 @@ def test_sql_resources_list_sql_databases(self, resource_group): response = self.client.sql_resources.list_sql_databases( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_sql_resources_get_sql_database(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -61,19 +61,13 @@ def test_sql_resources_begin_create_update_sql_database(self, resource_group): }, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -86,7 +80,7 @@ def test_sql_resources_begin_delete_sql_database(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -99,7 +93,7 @@ def test_sql_resources_get_sql_database_throughput(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -124,21 +118,14 @@ def test_sql_resources_begin_update_sql_database_throughput(self, resource_group "offerReplacePending": "str", "softAllowedMaximumThroughput": "str", "throughput": 0, - "throughputBuckets": [{"id": 0, "maxThroughputPercentage": 0}], }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -151,7 +138,7 @@ def test_sql_resources_begin_migrate_sql_database_to_autoscale(self, resource_gr resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -164,56 +151,7 @@ def test_sql_resources_begin_migrate_sql_database_to_manual_throughput(self, res resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_sql_resources_list_client_encryption_keys(self, resource_group): - response = self.client.sql_resources.list_client_encryption_keys( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - api_version="2024-12-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_sql_resources_get_client_encryption_key(self, resource_group): - response = self.client.sql_resources.get_client_encryption_key( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - client_encryption_key_name="str", - api_version="2024-12-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_sql_resources_begin_create_update_client_encryption_key(self, resource_group): - response = self.client.sql_resources.begin_create_update_client_encryption_key( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - client_encryption_key_name="str", - create_update_client_encryption_key_parameters={ - "resource": { - "encryptionAlgorithm": "str", - "id": "str", - "keyWrapMetadata": {"algorithm": "str", "name": "str", "type": "str", "value": "str"}, - "wrappedDataEncryptionKey": bytes("bytes", encoding="utf-8"), - } - }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -226,7 +164,7 @@ def test_sql_resources_list_sql_containers(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -240,7 +178,7 @@ def test_sql_resources_get_sql_container(self, resource_group): account_name="str", database_name="str", container_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -277,6 +215,7 @@ def test_sql_resources_begin_create_update_sql_container(self, resource_group): }, "createMode": "Default", "defaultTtl": 0, + "fullTextPolicy": {"defaultLanguage": "str", "fullTextPaths": [{"path": "str", "language": "str"}]}, "indexingPolicy": { "automatic": bool, "compositeIndexes": [[{"order": "str", "path": "str"}]], @@ -288,11 +227,6 @@ def test_sql_resources_begin_create_update_sql_container(self, resource_group): "spatialIndexes": [{"path": "str", "types": ["str"]}], "vectorIndexes": [{"path": "str", "type": "str"}], }, - "materializedViewDefinition": { - "definition": "str", - "sourceCollectionId": "str", - "sourceCollectionRid": "str", - }, "partitionKey": {"kind": "Hash", "paths": ["str"], "systemKey": bool, "version": 0}, "restoreParameters": { "restoreSource": "str", @@ -307,19 +241,13 @@ def test_sql_resources_begin_create_update_sql_container(self, resource_group): }, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -333,36 +261,7 @@ def test_sql_resources_begin_delete_sql_container(self, resource_group): account_name="str", database_name="str", container_name="str", - api_version="2024-12-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_sql_resources_begin_sql_database_partition_merge(self, resource_group): - response = self.client.sql_resources.begin_sql_database_partition_merge( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - merge_parameters={"isDryRun": bool}, - api_version="2024-12-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_sql_resources_begin_list_sql_container_partition_merge(self, resource_group): - response = self.client.sql_resources.begin_list_sql_container_partition_merge( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - container_name="str", - merge_parameters={"isDryRun": bool}, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -376,7 +275,7 @@ def test_sql_resources_get_sql_container_throughput(self, resource_group): account_name="str", database_name="str", container_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -402,21 +301,14 @@ def test_sql_resources_begin_update_sql_container_throughput(self, resource_grou "offerReplacePending": "str", "softAllowedMaximumThroughput": "str", "throughput": 0, - "throughputBuckets": [{"id": 0, "maxThroughputPercentage": 0}], }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -430,7 +322,7 @@ def test_sql_resources_begin_migrate_sql_container_to_autoscale(self, resource_g account_name="str", database_name="str", container_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -444,34 +336,7 @@ def test_sql_resources_begin_migrate_sql_container_to_manual_throughput(self, re account_name="str", database_name="str", container_name="str", - api_version="2024-12-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_sql_resources_begin_sql_database_retrieve_throughput_distribution(self, resource_group): - response = self.client.sql_resources.begin_sql_database_retrieve_throughput_distribution( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - retrieve_throughput_parameters={ - "resource": {"physicalPartitionIds": [{"id": "str"}]}, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -479,90 +344,48 @@ def test_sql_resources_begin_sql_database_retrieve_throughput_distribution(self, @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_sql_resources_begin_sql_database_redistribute_throughput(self, resource_group): - response = self.client.sql_resources.begin_sql_database_redistribute_throughput( + def test_sql_resources_list_client_encryption_keys(self, resource_group): + response = self.client.sql_resources.list_client_encryption_keys( resource_group_name=resource_group.name, account_name="str", database_name="str", - redistribute_throughput_parameters={ - "resource": { - "sourcePhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "targetPhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "throughputPolicy": "str", - }, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-12-01-preview", - ).result() # call '.result()' to poll until service return final result - + api_version="2025-04-15", + ) + result = [r for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_sql_resources_begin_sql_container_retrieve_throughput_distribution(self, resource_group): - response = self.client.sql_resources.begin_sql_container_retrieve_throughput_distribution( + def test_sql_resources_get_client_encryption_key(self, resource_group): + response = self.client.sql_resources.get_client_encryption_key( resource_group_name=resource_group.name, account_name="str", database_name="str", - container_name="str", - retrieve_throughput_parameters={ - "resource": {"physicalPartitionIds": [{"id": "str"}]}, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-12-01-preview", - ).result() # call '.result()' to poll until service return final result + client_encryption_key_name="str", + api_version="2025-04-15", + ) # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_sql_resources_begin_sql_container_redistribute_throughput(self, resource_group): - response = self.client.sql_resources.begin_sql_container_redistribute_throughput( + def test_sql_resources_begin_create_update_client_encryption_key(self, resource_group): + response = self.client.sql_resources.begin_create_update_client_encryption_key( resource_group_name=resource_group.name, account_name="str", database_name="str", - container_name="str", - redistribute_throughput_parameters={ + client_encryption_key_name="str", + create_update_client_encryption_key_parameters={ "resource": { - "sourcePhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "targetPhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "throughputPolicy": "str", - }, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", + "encryptionAlgorithm": "str", + "id": "str", + "keyWrapMetadata": {"algorithm": "str", "name": "str", "type": "str", "value": "str"}, + "wrappedDataEncryptionKey": bytes("bytes", encoding="utf-8"), + } }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -576,7 +399,7 @@ def test_sql_resources_list_sql_stored_procedures(self, resource_group): account_name="str", database_name="str", container_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -591,7 +414,7 @@ def test_sql_resources_get_sql_stored_procedure(self, resource_group): database_name="str", container_name="str", stored_procedure_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -609,19 +432,13 @@ def test_sql_resources_begin_create_update_sql_stored_procedure(self, resource_g create_update_sql_stored_procedure_parameters={ "resource": {"id": "str", "body": "str"}, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -636,7 +453,7 @@ def test_sql_resources_begin_delete_sql_stored_procedure(self, resource_group): database_name="str", container_name="str", stored_procedure_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -650,7 +467,7 @@ def test_sql_resources_list_sql_user_defined_functions(self, resource_group): account_name="str", database_name="str", container_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -665,7 +482,7 @@ def test_sql_resources_get_sql_user_defined_function(self, resource_group): database_name="str", container_name="str", user_defined_function_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -683,19 +500,13 @@ def test_sql_resources_begin_create_update_sql_user_defined_function(self, resou create_update_sql_user_defined_function_parameters={ "resource": {"id": "str", "body": "str"}, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -710,7 +521,7 @@ def test_sql_resources_begin_delete_sql_user_defined_function(self, resource_gro database_name="str", container_name="str", user_defined_function_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -724,7 +535,7 @@ def test_sql_resources_list_sql_triggers(self, resource_group): account_name="str", database_name="str", container_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -739,7 +550,7 @@ def test_sql_resources_get_sql_trigger(self, resource_group): database_name="str", container_name="str", trigger_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -757,19 +568,13 @@ def test_sql_resources_begin_create_update_sql_trigger(self, resource_group): create_update_sql_trigger_parameters={ "resource": {"id": "str", "body": "str", "triggerOperation": "str", "triggerType": "str"}, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -784,7 +589,7 @@ def test_sql_resources_begin_delete_sql_trigger(self, resource_group): database_name="str", container_name="str", trigger_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -797,7 +602,7 @@ def test_sql_resources_get_sql_role_definition(self, resource_group): role_definition_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -816,7 +621,7 @@ def test_sql_resources_begin_create_update_sql_role_definition(self, resource_gr "roleName": "str", "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -829,7 +634,7 @@ def test_sql_resources_begin_delete_sql_role_definition(self, resource_group): role_definition_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -841,7 +646,7 @@ def test_sql_resources_list_sql_role_definitions(self, resource_group): response = self.client.sql_resources.list_sql_role_definitions( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -854,7 +659,7 @@ def test_sql_resources_get_sql_role_assignment(self, resource_group): role_assignment_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -872,7 +677,7 @@ def test_sql_resources_begin_create_update_sql_role_assignment(self, resource_gr "roleDefinitionId": "str", "scope": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -885,7 +690,7 @@ def test_sql_resources_begin_delete_sql_role_assignment(self, resource_group): role_assignment_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -897,7 +702,7 @@ def test_sql_resources_list_sql_role_assignments(self, resource_group): response = self.client.sql_resources.list_sql_role_assignments( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -912,7 +717,7 @@ def test_sql_resources_begin_retrieve_continuous_backup_information(self, resour database_name="str", container_name="str", location={"location": "str"}, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_sql_resources_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_sql_resources_operations_async.py index 158028d4ee1f..1d06b1395991 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_sql_resources_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_sql_resources_operations_async.py @@ -25,7 +25,7 @@ async def test_sql_resources_list_sql_databases(self, resource_group): response = self.client.sql_resources.list_sql_databases( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_sql_resources_get_sql_database(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -63,19 +63,13 @@ async def test_sql_resources_begin_create_update_sql_database(self, resource_gro }, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -90,7 +84,7 @@ async def test_sql_resources_begin_delete_sql_database(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -104,7 +98,7 @@ async def test_sql_resources_get_sql_database_throughput(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -130,21 +124,14 @@ async def test_sql_resources_begin_update_sql_database_throughput(self, resource "offerReplacePending": "str", "softAllowedMaximumThroughput": "str", "throughput": 0, - "throughputBuckets": [{"id": 0, "maxThroughputPercentage": 0}], }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -159,7 +146,7 @@ async def test_sql_resources_begin_migrate_sql_database_to_autoscale(self, resou resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -174,58 +161,7 @@ async def test_sql_resources_begin_migrate_sql_database_to_manual_throughput(sel resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_sql_resources_list_client_encryption_keys(self, resource_group): - response = self.client.sql_resources.list_client_encryption_keys( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - api_version="2024-12-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_sql_resources_get_client_encryption_key(self, resource_group): - response = await self.client.sql_resources.get_client_encryption_key( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - client_encryption_key_name="str", - api_version="2024-12-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_sql_resources_begin_create_update_client_encryption_key(self, resource_group): - response = await ( - await self.client.sql_resources.begin_create_update_client_encryption_key( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - client_encryption_key_name="str", - create_update_client_encryption_key_parameters={ - "resource": { - "encryptionAlgorithm": "str", - "id": "str", - "keyWrapMetadata": {"algorithm": "str", "name": "str", "type": "str", "value": "str"}, - "wrappedDataEncryptionKey": bytes("bytes", encoding="utf-8"), - } - }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -239,7 +175,7 @@ async def test_sql_resources_list_sql_containers(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -253,7 +189,7 @@ async def test_sql_resources_get_sql_container(self, resource_group): account_name="str", database_name="str", container_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -291,6 +227,10 @@ async def test_sql_resources_begin_create_update_sql_container(self, resource_gr }, "createMode": "Default", "defaultTtl": 0, + "fullTextPolicy": { + "defaultLanguage": "str", + "fullTextPaths": [{"path": "str", "language": "str"}], + }, "indexingPolicy": { "automatic": bool, "compositeIndexes": [[{"order": "str", "path": "str"}]], @@ -302,11 +242,6 @@ async def test_sql_resources_begin_create_update_sql_container(self, resource_gr "spatialIndexes": [{"path": "str", "types": ["str"]}], "vectorIndexes": [{"path": "str", "type": "str"}], }, - "materializedViewDefinition": { - "definition": "str", - "sourceCollectionId": "str", - "sourceCollectionRid": "str", - }, "partitionKey": {"kind": "Hash", "paths": ["str"], "systemKey": bool, "version": 0}, "restoreParameters": { "restoreSource": "str", @@ -321,19 +256,13 @@ async def test_sql_resources_begin_create_update_sql_container(self, resource_gr }, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -349,40 +278,7 @@ async def test_sql_resources_begin_delete_sql_container(self, resource_group): account_name="str", database_name="str", container_name="str", - api_version="2024-12-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_sql_resources_begin_sql_database_partition_merge(self, resource_group): - response = await ( - await self.client.sql_resources.begin_sql_database_partition_merge( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - merge_parameters={"isDryRun": bool}, - api_version="2024-12-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_sql_resources_begin_list_sql_container_partition_merge(self, resource_group): - response = await ( - await self.client.sql_resources.begin_list_sql_container_partition_merge( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - container_name="str", - merge_parameters={"isDryRun": bool}, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -397,7 +293,7 @@ async def test_sql_resources_get_sql_container_throughput(self, resource_group): account_name="str", database_name="str", container_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -424,21 +320,14 @@ async def test_sql_resources_begin_update_sql_container_throughput(self, resourc "offerReplacePending": "str", "softAllowedMaximumThroughput": "str", "throughput": 0, - "throughputBuckets": [{"id": 0, "maxThroughputPercentage": 0}], }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -454,7 +343,7 @@ async def test_sql_resources_begin_migrate_sql_container_to_autoscale(self, reso account_name="str", database_name="str", container_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -470,36 +359,7 @@ async def test_sql_resources_begin_migrate_sql_container_to_manual_throughput(se account_name="str", database_name="str", container_name="str", - api_version="2024-12-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_sql_resources_begin_sql_database_retrieve_throughput_distribution(self, resource_group): - response = await ( - await self.client.sql_resources.begin_sql_database_retrieve_throughput_distribution( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - retrieve_throughput_parameters={ - "resource": {"physicalPartitionIds": [{"id": "str"}]}, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -508,95 +368,49 @@ async def test_sql_resources_begin_sql_database_retrieve_throughput_distribution @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_sql_resources_begin_sql_database_redistribute_throughput(self, resource_group): - response = await ( - await self.client.sql_resources.begin_sql_database_redistribute_throughput( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - redistribute_throughput_parameters={ - "resource": { - "sourcePhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "targetPhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "throughputPolicy": "str", - }, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-12-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - + async def test_sql_resources_list_client_encryption_keys(self, resource_group): + response = self.client.sql_resources.list_client_encryption_keys( + resource_group_name=resource_group.name, + account_name="str", + database_name="str", + api_version="2025-04-15", + ) + 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_sql_resources_begin_sql_container_retrieve_throughput_distribution(self, resource_group): - response = await ( - await self.client.sql_resources.begin_sql_container_retrieve_throughput_distribution( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - container_name="str", - retrieve_throughput_parameters={ - "resource": {"physicalPartitionIds": [{"id": "str"}]}, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-12-01-preview", - ) - ).result() # call '.result()' to poll until service return final result + async def test_sql_resources_get_client_encryption_key(self, resource_group): + response = await self.client.sql_resources.get_client_encryption_key( + resource_group_name=resource_group.name, + account_name="str", + database_name="str", + client_encryption_key_name="str", + api_version="2025-04-15", + ) # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_sql_resources_begin_sql_container_redistribute_throughput(self, resource_group): + async def test_sql_resources_begin_create_update_client_encryption_key(self, resource_group): response = await ( - await self.client.sql_resources.begin_sql_container_redistribute_throughput( + await self.client.sql_resources.begin_create_update_client_encryption_key( resource_group_name=resource_group.name, account_name="str", database_name="str", - container_name="str", - redistribute_throughput_parameters={ + client_encryption_key_name="str", + create_update_client_encryption_key_parameters={ "resource": { - "sourcePhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "targetPhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "throughputPolicy": "str", - }, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", + "encryptionAlgorithm": "str", + "id": "str", + "keyWrapMetadata": {"algorithm": "str", "name": "str", "type": "str", "value": "str"}, + "wrappedDataEncryptionKey": bytes("bytes", encoding="utf-8"), + } }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -611,7 +425,7 @@ async def test_sql_resources_list_sql_stored_procedures(self, resource_group): account_name="str", database_name="str", container_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -626,7 +440,7 @@ async def test_sql_resources_get_sql_stored_procedure(self, resource_group): database_name="str", container_name="str", stored_procedure_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -645,19 +459,13 @@ async def test_sql_resources_begin_create_update_sql_stored_procedure(self, reso create_update_sql_stored_procedure_parameters={ "resource": {"id": "str", "body": "str"}, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -674,7 +482,7 @@ async def test_sql_resources_begin_delete_sql_stored_procedure(self, resource_gr database_name="str", container_name="str", stored_procedure_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -689,7 +497,7 @@ async def test_sql_resources_list_sql_user_defined_functions(self, resource_grou account_name="str", database_name="str", container_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -704,7 +512,7 @@ async def test_sql_resources_get_sql_user_defined_function(self, resource_group) database_name="str", container_name="str", user_defined_function_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -723,19 +531,13 @@ async def test_sql_resources_begin_create_update_sql_user_defined_function(self, create_update_sql_user_defined_function_parameters={ "resource": {"id": "str", "body": "str"}, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -752,7 +554,7 @@ async def test_sql_resources_begin_delete_sql_user_defined_function(self, resour database_name="str", container_name="str", user_defined_function_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -767,7 +569,7 @@ async def test_sql_resources_list_sql_triggers(self, resource_group): account_name="str", database_name="str", container_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -782,7 +584,7 @@ async def test_sql_resources_get_sql_trigger(self, resource_group): database_name="str", container_name="str", trigger_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -801,19 +603,13 @@ async def test_sql_resources_begin_create_update_sql_trigger(self, resource_grou create_update_sql_trigger_parameters={ "resource": {"id": "str", "body": "str", "triggerOperation": "str", "triggerType": "str"}, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -830,7 +626,7 @@ async def test_sql_resources_begin_delete_sql_trigger(self, resource_group): database_name="str", container_name="str", trigger_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -844,7 +640,7 @@ async def test_sql_resources_get_sql_role_definition(self, resource_group): role_definition_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -864,7 +660,7 @@ async def test_sql_resources_begin_create_update_sql_role_definition(self, resou "roleName": "str", "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -879,7 +675,7 @@ async def test_sql_resources_begin_delete_sql_role_definition(self, resource_gro role_definition_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -892,7 +688,7 @@ async def test_sql_resources_list_sql_role_definitions(self, resource_group): response = self.client.sql_resources.list_sql_role_definitions( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -905,7 +701,7 @@ async def test_sql_resources_get_sql_role_assignment(self, resource_group): role_assignment_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -924,7 +720,7 @@ async def test_sql_resources_begin_create_update_sql_role_assignment(self, resou "roleDefinitionId": "str", "scope": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -939,7 +735,7 @@ async def test_sql_resources_begin_delete_sql_role_assignment(self, resource_gro role_assignment_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -952,7 +748,7 @@ async def test_sql_resources_list_sql_role_assignments(self, resource_group): response = self.client.sql_resources.list_sql_role_assignments( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -968,7 +764,7 @@ async def test_sql_resources_begin_retrieve_continuous_backup_information(self, database_name="str", container_name="str", location={"location": "str"}, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_table_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_table_resources_operations.py index 10958ac2998e..35eec05ef019 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_table_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_table_resources_operations.py @@ -24,7 +24,7 @@ def test_table_resources_list_tables(self, resource_group): response = self.client.table_resources.list_tables( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_table_resources_get_table(self, resource_group): resource_group_name=resource_group.name, account_name="str", table_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -61,19 +61,13 @@ def test_table_resources_begin_create_update_table(self, resource_group): }, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -86,7 +80,7 @@ def test_table_resources_begin_delete_table(self, resource_group): resource_group_name=resource_group.name, account_name="str", table_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -99,7 +93,7 @@ def test_table_resources_get_table_throughput(self, resource_group): resource_group_name=resource_group.name, account_name="str", table_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -124,21 +118,14 @@ def test_table_resources_begin_update_table_throughput(self, resource_group): "offerReplacePending": "str", "softAllowedMaximumThroughput": "str", "throughput": 0, - "throughputBuckets": [{"id": 0, "maxThroughputPercentage": 0}], }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -151,7 +138,7 @@ def test_table_resources_begin_migrate_table_to_autoscale(self, resource_group): resource_group_name=resource_group.name, account_name="str", table_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -164,7 +151,7 @@ def test_table_resources_begin_migrate_table_to_manual_throughput(self, resource resource_group_name=resource_group.name, account_name="str", table_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -178,143 +165,8 @@ def test_table_resources_begin_retrieve_continuous_backup_information(self, reso account_name="str", table_name="str", location={"location": "str"}, - api_version="2024-12-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_table_resources_get_table_role_definition(self, resource_group): - response = self.client.table_resources.get_table_role_definition( - resource_group_name=resource_group.name, - account_name="str", - role_definition_id="str", - api_version="2024-12-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_table_resources_begin_create_update_table_role_definition(self, resource_group): - response = self.client.table_resources.begin_create_update_table_role_definition( - resource_group_name=resource_group.name, - account_name="str", - role_definition_id="str", - create_update_table_role_definition_parameters={ - "assignableScopes": ["str"], - "id": "str", - "name": "str", - "permissions": [{"dataActions": ["str"], "id": "str", "notDataActions": ["str"]}], - "roleName": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - api_version="2024-12-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_table_resources_begin_delete_table_role_definition(self, resource_group): - response = self.client.table_resources.begin_delete_table_role_definition( - resource_group_name=resource_group.name, - account_name="str", - role_definition_id="str", - api_version="2024-12-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_table_resources_list_table_role_definitions(self, resource_group): - response = self.client.table_resources.list_table_role_definitions( - resource_group_name=resource_group.name, - account_name="str", - api_version="2024-12-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_table_resources_get_table_role_assignment(self, resource_group): - response = self.client.table_resources.get_table_role_assignment( - resource_group_name=resource_group.name, - account_name="str", - role_assignment_id="str", - api_version="2024-12-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_table_resources_begin_create_update_table_role_assignment(self, resource_group): - response = self.client.table_resources.begin_create_update_table_role_assignment( - resource_group_name=resource_group.name, - account_name="str", - role_assignment_id="str", - create_update_table_role_assignment_parameters={ - "id": "str", - "name": "str", - "principalId": "str", - "provisioningState": "str", - "roleDefinitionId": "str", - "scope": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ).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_table_resources_begin_delete_table_role_assignment(self, resource_group): - response = self.client.table_resources.begin_delete_table_role_assignment( - resource_group_name=resource_group.name, - account_name="str", - role_assignment_id="str", - api_version="2024-12-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_table_resources_list_table_role_assignments(self, resource_group): - response = self.client.table_resources.list_table_role_assignments( - resource_group_name=resource_group.name, - account_name="str", - api_version="2024-12-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_table_resources_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_table_resources_operations_async.py index dc6e0fd058bb..ada3300b452a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_table_resources_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_table_resources_operations_async.py @@ -25,7 +25,7 @@ async def test_table_resources_list_tables(self, resource_group): response = self.client.table_resources.list_tables( resource_group_name=resource_group.name, account_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_table_resources_get_table(self, resource_group): resource_group_name=resource_group.name, account_name="str", table_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -63,19 +63,13 @@ async def test_table_resources_begin_create_update_table(self, resource_group): }, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -90,7 +84,7 @@ async def test_table_resources_begin_delete_table(self, resource_group): resource_group_name=resource_group.name, account_name="str", table_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -104,7 +98,7 @@ async def test_table_resources_get_table_throughput(self, resource_group): resource_group_name=resource_group.name, account_name="str", table_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) # please add some check logic here by yourself @@ -130,21 +124,14 @@ async def test_table_resources_begin_update_table_throughput(self, resource_grou "offerReplacePending": "str", "softAllowedMaximumThroughput": "str", "throughput": 0, - "throughputBuckets": [{"id": 0, "maxThroughputPercentage": 0}], }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -159,7 +146,7 @@ async def test_table_resources_begin_migrate_table_to_autoscale(self, resource_g resource_group_name=resource_group.name, account_name="str", table_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -174,7 +161,7 @@ async def test_table_resources_begin_migrate_table_to_manual_throughput(self, re resource_group_name=resource_group.name, account_name="str", table_name="str", - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).result() # call '.result()' to poll until service return final result @@ -190,152 +177,9 @@ async def test_table_resources_begin_retrieve_continuous_backup_information(self account_name="str", table_name="str", location={"location": "str"}, - api_version="2024-12-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_table_resources_get_table_role_definition(self, resource_group): - response = await self.client.table_resources.get_table_role_definition( - resource_group_name=resource_group.name, - account_name="str", - role_definition_id="str", - api_version="2024-12-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_table_resources_begin_create_update_table_role_definition(self, resource_group): - response = await ( - await self.client.table_resources.begin_create_update_table_role_definition( - resource_group_name=resource_group.name, - account_name="str", - role_definition_id="str", - create_update_table_role_definition_parameters={ - "assignableScopes": ["str"], - "id": "str", - "name": "str", - "permissions": [{"dataActions": ["str"], "id": "str", "notDataActions": ["str"]}], - "roleName": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - api_version="2024-12-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_table_resources_begin_delete_table_role_definition(self, resource_group): - response = await ( - await self.client.table_resources.begin_delete_table_role_definition( - resource_group_name=resource_group.name, - account_name="str", - role_definition_id="str", - api_version="2024-12-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_table_resources_list_table_role_definitions(self, resource_group): - response = self.client.table_resources.list_table_role_definitions( - resource_group_name=resource_group.name, - account_name="str", - api_version="2024-12-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_table_resources_get_table_role_assignment(self, resource_group): - response = await self.client.table_resources.get_table_role_assignment( - resource_group_name=resource_group.name, - account_name="str", - role_assignment_id="str", - api_version="2024-12-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_table_resources_begin_create_update_table_role_assignment(self, resource_group): - response = await ( - await self.client.table_resources.begin_create_update_table_role_assignment( - resource_group_name=resource_group.name, - account_name="str", - role_assignment_id="str", - create_update_table_role_assignment_parameters={ - "id": "str", - "name": "str", - "principalId": "str", - "provisioningState": "str", - "roleDefinitionId": "str", - "scope": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - api_version="2024-12-01-preview", + api_version="2025-04-15", ) ).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_table_resources_begin_delete_table_role_assignment(self, resource_group): - response = await ( - await self.client.table_resources.begin_delete_table_role_assignment( - resource_group_name=resource_group.name, - account_name="str", - role_assignment_id="str", - api_version="2024-12-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_table_resources_list_table_role_assignments(self, resource_group): - response = self.client.table_resources.list_table_role_assignments( - resource_group_name=resource_group.name, - account_name="str", - api_version="2024-12-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/sdk_packaging.toml b/sdk/cosmos/azure-mgmt-cosmosdb/sdk_packaging.toml index 86347b41f19b..4a4ab4d8cbce 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/sdk_packaging.toml +++ b/sdk/cosmos/azure-mgmt-cosmosdb/sdk_packaging.toml @@ -3,7 +3,7 @@ package_name = "azure-mgmt-cosmosdb" package_nspkg = "azure-mgmt-nspkg" package_pprint_name = "Cosmos DB Management" package_doc_id = "cosmosdb" -is_stable = false +is_stable = true is_arm = true sample_link = "" title = "CosmosDBManagementClient" diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/setup.py b/sdk/cosmos/azure-mgmt-cosmosdb/setup.py index 1c3e0324429f..04300d8bd291 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/setup.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/setup.py @@ -49,7 +49,7 @@ url="https://github.com/Azure/azure-sdk-for-python", keywords="azure, azure sdk", # update with search keywords relevant to the azure service / product classifiers=[ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3",