From 0fcb5807981859472e8699a7436f7945bf5a6127 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 25 Jan 2023 21:06:20 +0000 Subject: [PATCH] CodeGen from PR 22117 in Azure/azure-rest-api-specs Merge f88d41fb476e8a26ec750eefdc940d273e923a63 into 7b47689d4efc098f25f46781f05f22179c153314 --- sdk/cosmos/azure-mgmt-cosmosdb/_meta.json | 6 +- .../azure/mgmt/cosmosdb/__init__.py | 2 +- .../azure/mgmt/cosmosdb/_configuration.py | 9 +- .../cosmosdb/_cosmos_db_management_client.py | 21 +- .../azure/mgmt/cosmosdb/_serialization.py | 174 +- .../azure/mgmt/cosmosdb/_vendor.py | 5 +- .../azure/mgmt/cosmosdb/_version.py | 2 +- .../azure/mgmt/cosmosdb/aio/__init__.py | 2 +- .../azure/mgmt/cosmosdb/aio/_configuration.py | 4 +- .../aio/_cosmos_db_management_client.py | 12 +- .../mgmt/cosmosdb/aio/operations/__init__.py | 4 +- .../_cassandra_clusters_operations.py | 440 ++-- .../_cassandra_data_centers_operations.py | 148 +- .../_cassandra_repair_operations.py | 1639 +++++++++++++ .../_cassandra_resources_operations.py | 666 ++--- .../aio/operations/_collection_operations.py | 54 +- .../_collection_partition_operations.py | 36 +- ..._collection_partition_region_operations.py | 18 +- .../_collection_region_operations.py | 18 +- .../_data_transfer_jobs_operations.py | 90 +- .../_database_account_region_operations.py | 18 +- .../_database_accounts_operations.py | 422 ++-- .../aio/operations/_database_operations.py | 54 +- .../operations/_graph_resources_operations.py | 102 +- .../_gremlin_resources_operations.py | 484 ++-- .../aio/operations/_locations_operations.py | 28 +- .../_mongo_db_resources_operations.py | 888 ++++--- .../_notebook_workspaces_operations.py | 180 +- .../cosmosdb/aio/operations/_operations.py | 16 +- .../_partition_key_range_id_operations.py | 18 +- ...artition_key_range_id_region_operations.py | 18 +- .../aio/operations/_percentile_operations.py | 18 +- .../_percentile_source_target_operations.py | 18 +- .../_percentile_target_operations.py | 18 +- ...private_endpoint_connections_operations.py | 102 +- .../_private_link_resources_operations.py | 32 +- ...restorable_database_accounts_operations.py | 48 +- ...restorable_gremlin_databases_operations.py | 18 +- .../_restorable_gremlin_graphs_operations.py | 18 +- ...restorable_gremlin_resources_operations.py | 18 +- ...storable_mongodb_collections_operations.py | 18 +- ...restorable_mongodb_databases_operations.py | 18 +- ...restorable_mongodb_resources_operations.py | 18 +- .../_restorable_sql_containers_operations.py | 18 +- .../_restorable_sql_databases_operations.py | 18 +- .../_restorable_sql_resources_operations.py | 18 +- .../_restorable_table_resources_operations.py | 18 +- .../_restorable_tables_operations.py | 18 +- .../aio/operations/_service_operations.py | 102 +- .../operations/_sql_resources_operations.py | 1264 +++++----- .../operations/_table_resources_operations.py | 262 +- .../azure/mgmt/cosmosdb/models/__init__.py | 40 +- .../_cosmos_db_management_client_enums.py | 15 +- .../azure/mgmt/cosmosdb/models/_models_py3.py | 2158 ++++++++++++----- .../mgmt/cosmosdb/operations/__init__.py | 4 +- .../_cassandra_clusters_operations.py | 599 ++--- .../_cassandra_data_centers_operations.py | 192 +- .../_cassandra_repair_operations.py | 2059 ++++++++++++++++ .../_cassandra_resources_operations.py | 870 ++++--- .../operations/_collection_operations.py | 78 +- .../_collection_partition_operations.py | 52 +- ..._collection_partition_region_operations.py | 26 +- .../_collection_region_operations.py | 26 +- .../_data_transfer_jobs_operations.py | 140 +- .../_database_account_region_operations.py | 26 +- .../_database_accounts_operations.py | 578 +++-- .../operations/_database_operations.py | 78 +- .../operations/_graph_resources_operations.py | 136 +- .../_gremlin_resources_operations.py | 630 ++--- .../operations/_locations_operations.py | 44 +- .../_mongo_db_resources_operations.py | 1152 +++++---- .../_notebook_workspaces_operations.py | 238 +- .../mgmt/cosmosdb/operations/_operations.py | 22 +- .../_partition_key_range_id_operations.py | 26 +- ...artition_key_range_id_region_operations.py | 26 +- .../operations/_percentile_operations.py | 26 +- .../_percentile_source_target_operations.py | 26 +- .../_percentile_target_operations.py | 26 +- ...private_endpoint_connections_operations.py | 136 +- .../_private_link_resources_operations.py | 48 +- ...restorable_database_accounts_operations.py | 72 +- ...restorable_gremlin_databases_operations.py | 26 +- .../_restorable_gremlin_graphs_operations.py | 26 +- ...restorable_gremlin_resources_operations.py | 26 +- ...storable_mongodb_collections_operations.py | 26 +- ...restorable_mongodb_databases_operations.py | 26 +- ...restorable_mongodb_resources_operations.py | 26 +- .../_restorable_sql_containers_operations.py | 26 +- .../_restorable_sql_databases_operations.py | 26 +- .../_restorable_sql_resources_operations.py | 26 +- .../_restorable_table_resources_operations.py | 26 +- .../_restorable_tables_operations.py | 26 +- .../operations/_service_operations.py | 136 +- .../operations/_sql_resources_operations.py | 1656 +++++++------ .../operations/_table_resources_operations.py | 340 +-- ...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 | 2 +- .../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 | 2 +- .../cosmos_db_cassandra_view_delete.py | 2 +- .../cosmos_db_cassandra_view_get.py | 2 +- .../cosmos_db_cassandra_view_list.py | 2 +- ..._db_cassandra_view_migrate_to_autoscale.py | 2 +- ...andra_view_migrate_to_manual_throughput.py | 2 +- ...cosmos_db_cassandra_view_throughput_get.py | 2 +- ...mos_db_cassandra_view_throughput_update.py | 2 +- ...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 | 45 + ...smos_db_collection_partition_get_usages.py | 44 + ...collection_partition_region_get_metrics.py | 46 + .../cosmos_db_data_transfer_job_cancel.py | 42 + .../cosmos_db_data_transfer_job_create.py | 2 +- .../cosmos_db_data_transfer_job_feed.py | 2 +- .../cosmos_db_data_transfer_job_get.py | 2 +- .../cosmos_db_data_transfer_job_pause.py | 2 +- .../cosmos_db_data_transfer_job_resume.py | 42 + ...cosmos_db_data_transfer_service_create.py} | 4 +- ...cosmos_db_data_transfer_service_delete.py} | 4 +- ...=> cosmos_db_data_transfer_service_get.py} | 4 +- ...s_db_database_account_check_name_exists.py | 2 +- .../cosmos_db_database_account_create_max.py | 2 +- .../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 | 2 +- ...smos_db_database_account_offline_region.py | 2 +- ...osmos_db_database_account_online_region.py | 2 +- .../cosmos_db_database_account_patch.py | 2 +- ...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 +- ...os_db_graph_api_compute_service_create.py} | 4 +- ...os_db_graph_api_compute_service_delete.py} | 4 +- ...osmos_db_graph_api_compute_service_get.py} | 4 +- ...cosmos_db_graph_resource_create_update.py} | 4 +- .../cosmos_db_graph_resource_delete.py | 42 + .../cosmos_db_graph_resource_get.py | 42 + .../cosmos_db_graph_resource_list.py | 42 + ...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 | 42 - ...osmos_db_managed_cassandra_backups_list.py | 42 - ...mos_db_managed_cassandra_cluster_create.py | 2 +- ...db_managed_cassandra_cluster_deallocate.py | 2 +- ...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 | 2 +- .../cosmos_db_managed_cassandra_command.py | 2 +- ...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} | 4 +- .../cosmos_db_managed_cassandra_status.py | 2 +- ...erialized_views_builder_service_create.py} | 4 +- ...erialized_views_builder_service_delete.py} | 4 +- ...materialized_views_builder_service_get.py} | 4 +- ..._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 | 2 +- ...o_db_collection_redistribute_throughput.py | 2 +- ...ection_retrieve_throughput_distribution.py | 2 +- ...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 +- ...ngo_db_database_redistribute_throughput.py | 2 +- ...tabase_retrieve_throughput_distribution.py | 2 +- ...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} | 4 +- ...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 | 43 + ...db_percentile_source_target_get_metrics.py | 45 + ...cosmos_db_percentile_target_get_metrics.py | 44 + ..._db_private_endpoint_connection_delete.py} | 4 +- ...smos_db_private_endpoint_connection_get.py | 42 + ...b_private_endpoint_connection_list_get.py} | 4 +- ..._db_private_endpoint_connection_update.py} | 4 +- .../cosmos_db_private_link_resource_get.py | 42 + ...osmos_db_private_link_resource_list_get.py | 42 + ...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 +- ...ql_client_encryption_key_create_update.py} | 4 +- ...osmos_db_sql_client_encryption_key_get.py} | 4 +- ...mos_db_sql_client_encryption_keys_list.py} | 4 +- ...mos_db_sql_container_backup_information.py | 2 +- .../cosmos_db_sql_container_create_update.py | 2 +- .../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 | 2 +- ...b_sql_container_redistribute_throughput.py | 2 +- .../cosmos_db_sql_container_restore.py | 2 +- ...tainer_retrieve_throughput_distribution.py | 2 +- .../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 | 6 +- .../cosmos_db_sql_database_get.py | 6 +- .../cosmos_db_sql_database_list.py | 4 +- ...os_db_sql_database_migrate_to_autoscale.py | 2 +- ...l_database_migrate_to_manual_throughput.py | 2 +- ...db_sql_database_redistribute_throughput.py | 2 +- .../cosmos_db_sql_database_restore.py | 2 +- ...tabase_retrieve_throughput_distribution.py | 2 +- .../cosmos_db_sql_database_throughput_get.py | 2 +- ...osmos_db_sql_database_throughput_update.py | 2 +- ...b_sql_dedicated_gateway_service_create.py} | 4 +- ...b_sql_dedicated_gateway_service_delete.py} | 4 +- ...s_db_sql_dedicated_gateway_service_get.py} | 4 +- ...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} | 4 +- ...ce.py => cosmos_db_table_create_update.py} | 4 +- .../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 | 46 + ...mos_dbp_key_range_id_region_get_metrics.py | 47 + 325 files changed, 13492 insertions(+), 7377 deletions(-) create mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_repair_operations.py create mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_repair_operations.py create mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_get_metrics.py create mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_get_usages.py create mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_region_get_metrics.py create mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_cancel.py create mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_resume.py rename sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/{data_transfer_service_create.py => cosmos_db_data_transfer_service_create.py} (93%) rename sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/{data_transfer_service_delete.py => cosmos_db_data_transfer_service_delete.py} (92%) rename sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/{data_transfer_service_get.py => cosmos_db_data_transfer_service_get.py} (92%) rename sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/{graph_api_compute_service_create.py => cosmos_db_graph_api_compute_service_create.py} (93%) rename sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/{graph_api_compute_service_delete.py => cosmos_db_graph_api_compute_service_delete.py} (92%) rename sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/{graph_api_compute_service_get.py => cosmos_db_graph_api_compute_service_get.py} (92%) rename sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/{cosmos_db_graph_create_update.py => cosmos_db_graph_resource_create_update.py} (93%) create mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_delete.py create mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_get.py create 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 rename sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/{cosmos_db_managed_cassandra_data_center_update.py => cosmos_db_managed_cassandra_data_center_patch.py} (94%) rename sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/{materialized_views_builder_service_create.py => cosmos_db_materialized_views_builder_service_create.py} (92%) rename sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/{materialized_views_builder_service_delete.py => cosmos_db_materialized_views_builder_service_delete.py} (92%) rename sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/{materialized_views_builder_service_get.py => cosmos_db_materialized_views_builder_service_get.py} (92%) rename sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/{cosmos_db_mongo_role_definition_get.py => cosmos_db_mongo_db_role_definition_get.py} (93%) create mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_get_metrics.py create mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_source_target_get_metrics.py create mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_target_get_metrics.py rename sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/{deletes_a_private_endpoint_connection_with_a_given_name..py => cosmos_db_private_endpoint_connection_delete.py} (92%) create mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_get.py rename sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/{gets_private_endpoint_connection..py => cosmos_db_private_endpoint_connection_list_get.py} (92%) rename sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/{approve_or_reject_a_private_endpoint_connection_with_a_given_name..py => cosmos_db_private_endpoint_connection_update.py} (92%) create mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_link_resource_get.py create mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_link_resource_list_get.py rename sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/{cosmos_db_restore_database_account_create_update.json.py => cosmos_db_restore_database_account_create_update.py} (95%) rename sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/{cosmos_db_client_encryption_key_create_update.py => cosmos_db_sql_client_encryption_key_create_update.py} (94%) rename sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/{cosmos_db_client_encryption_key_get.py => cosmos_db_sql_client_encryption_key_get.py} (92%) rename sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/{cosmos_db_client_encryption_keys_list.py => cosmos_db_sql_client_encryption_keys_list.py} (92%) rename sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/{sql_dedicated_gateway_service_create.py => cosmos_db_sql_dedicated_gateway_service_create.py} (93%) rename sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/{sql_dedicated_gateway_service_delete.py => cosmos_db_sql_dedicated_gateway_service_delete.py} (92%) rename sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/{sql_dedicated_gateway_service_get.py => cosmos_db_sql_dedicated_gateway_service_get.py} (92%) rename sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/{cosmos_db_table_collection_backup_information.py => cosmos_db_table_backup_information.py} (92%) rename sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/{cosmos_db_table_replace.py => cosmos_db_table_create_update.py} (93%) create mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_dbp_key_range_id_get_metrics.py create mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_dbp_key_range_id_region_get_metrics.py diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/_meta.json b/sdk/cosmos/azure-mgmt-cosmosdb/_meta.json index 884de3757c9a..b201ac2e5e95 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/_meta.json +++ b/sdk/cosmos/azure-mgmt-cosmosdb/_meta.json @@ -1,11 +1,11 @@ { - "commit": "21426cf85836ec17aaa4f20f58324a8666925e34", + "commit": "e5693b78d130172d9e94cd7f04177c1a336c23c2", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ - "@autorest/python@6.2.1", + "@autorest/python@6.2.16", "@autorest/modelerfour@4.24.3" ], - "autorest_command": "autorest specification/cosmos-db/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.2.1 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", + "autorest_command": "autorest specification/cosmos-db/resource-manager/readme.md --generate-sample=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.2.16 --use=@autorest/modelerfour@4.24.3 --version=3.9.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/__init__.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/__init__.py index de0ee92a4749..2ffb9868aed3 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/__init__.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk 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 9b21cb3f7fe5..81a0a61170cf 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_configuration.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_configuration.py @@ -35,14 +35,14 @@ class CosmosDBManagementClientConfiguration(Configuration): # pylint: disable=t :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-08-15-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2022-11-15-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(CosmosDBManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-08-15-preview") # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop("api_version", "2022-11-15-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -56,10 +56,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs kwargs.setdefault("sdk_moniker", "mgmt-cosmosdb/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) 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 18bb993ec21a..356b420077ce 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 @@ -12,12 +12,13 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from ._configuration import CosmosDBManagementClientConfiguration from ._serialization import Deserializer, Serializer from .operations import ( CassandraClustersOperations, CassandraDataCentersOperations, + CassandraRepairOperations, CassandraResourcesOperations, CollectionOperations, CollectionPartitionOperations, @@ -115,6 +116,8 @@ class CosmosDBManagementClient: # pylint: disable=client-accepts-api-version-ke :vartype cassandra_clusters: azure.mgmt.cosmosdb.operations.CassandraClustersOperations :ivar cassandra_data_centers: CassandraDataCentersOperations operations :vartype cassandra_data_centers: azure.mgmt.cosmosdb.operations.CassandraDataCentersOperations + :ivar cassandra_repair: CassandraRepairOperations operations + :vartype cassandra_repair: azure.mgmt.cosmosdb.operations.CassandraRepairOperations :ivar notebook_workspaces: NotebookWorkspacesOperations operations :vartype notebook_workspaces: azure.mgmt.cosmosdb.operations.NotebookWorkspacesOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations @@ -165,7 +168,7 @@ class CosmosDBManagementClient: # pylint: disable=client-accepts-api-version-ke :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2022-08-15-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2022-11-15-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no @@ -184,7 +187,7 @@ def __init__( ) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -241,6 +244,9 @@ def __init__( self.cassandra_data_centers = CassandraDataCentersOperations( self._client, self._config, self._serialize, self._deserialize ) + self.cassandra_repair = CassandraRepairOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.notebook_workspaces = NotebookWorkspacesOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -310,15 +316,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> CosmosDBManagementClient + def __enter__(self) -> "CosmosDBManagementClient": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) 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 7c1dedb5133d..f17c068e833e 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_serialization.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_serialization.py @@ -25,6 +25,7 @@ # -------------------------------------------------------------------------- # pylint: skip-file +# pyright: reportUnnecessaryTypeIgnoreComment=false from base64 import b64decode, b64encode import calendar @@ -37,23 +38,38 @@ import re import sys import codecs +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + TypeVar, + MutableMapping, + Type, + List, + Mapping, +) try: from urllib import quote # type: ignore except ImportError: - from urllib.parse import quote # type: ignore + from urllib.parse import quote import xml.etree.ElementTree as ET -import isodate - -from typing import Dict, Any, cast, TYPE_CHECKING +import isodate # type: ignore from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback +from azure.core.serialization import NULL as AzureCoreNull _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") -if TYPE_CHECKING: - from typing import Optional, Union, AnyStr, IO, Mapping +ModelType = TypeVar("ModelType", bound="Model") +JSON = MutableMapping[str, Any] class RawDeserializer: @@ -65,8 +81,7 @@ class RawDeserializer: CONTEXT_NAME = "deserialized_data" @classmethod - def deserialize_from_text(cls, data, content_type=None): - # type: (Optional[Union[AnyStr, IO]], Optional[str]) -> Any + def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: """Decode data according to content-type. Accept a stream of data as well, but will be load at once in memory for now. @@ -132,8 +147,7 @@ def _json_attemp(data): raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) @classmethod - def deserialize_from_http_generics(cls, body_bytes, headers): - # type: (Optional[Union[AnyStr, IO]], Mapping) -> Any + def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: """Deserialize from HTTP response. Use bytes and headers to NOT use any requests/aiohttp or whatever @@ -160,8 +174,8 @@ def deserialize_from_http_generics(cls, body_bytes, headers): basestring # type: ignore unicode_str = unicode # type: ignore except NameError: - basestring = str # type: ignore - unicode_str = str # type: ignore + basestring = str + unicode_str = str _LOGGER = logging.getLogger(__name__) @@ -188,7 +202,7 @@ def dst(self, dt): try: - from datetime import timezone as _FixedOffset + from datetime import timezone as _FixedOffset # type: ignore except ImportError: # Python 2.7 class _FixedOffset(datetime.tzinfo): # type: ignore @@ -219,7 +233,7 @@ def __getinitargs__(self): try: from datetime import timezone - TZ_UTC = timezone.utc # type: ignore + TZ_UTC = timezone.utc except ImportError: TZ_UTC = UTC() # type: ignore @@ -276,12 +290,12 @@ class Model(object): serialization and deserialization. """ - _subtype_map = {} # type: Dict[str, Dict[str, Any]] - _attribute_map = {} # type: Dict[str, Dict[str, Any]] - _validation = {} # type: Dict[str, Dict[str, Any]] + _subtype_map: Dict[str, Dict[str, Any]] = {} + _attribute_map: Dict[str, Dict[str, Any]] = {} + _validation: Dict[str, Dict[str, Any]] = {} - def __init__(self, **kwargs): - self.additional_properties = {} + def __init__(self, **kwargs: Any) -> None: + self.additional_properties: Dict[str, Any] = {} for k in kwargs: if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) @@ -290,27 +304,27 @@ def __init__(self, **kwargs): else: setattr(self, k, kwargs[k]) - def __eq__(self, other): + def __eq__(self, other: Any) -> bool: """Compare objects by comparing all attributes.""" if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ return False - def __ne__(self, other): + def __ne__(self, other: Any) -> bool: """Compare objects by comparing all attributes.""" return not self.__eq__(other) - def __str__(self): + def __str__(self) -> str: return str(self.__dict__) @classmethod - def enable_additional_properties_sending(cls): + def enable_additional_properties_sending(cls) -> None: cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} @classmethod - def is_xml_model(cls): + def is_xml_model(cls) -> bool: try: - cls._xml_map + cls._xml_map # type: ignore except AttributeError: return False return True @@ -319,13 +333,13 @@ def is_xml_model(cls): def _create_xml_node(cls): """Create XML node.""" try: - xml_map = cls._xml_map + xml_map = cls._xml_map # type: ignore except AttributeError: xml_map = {} return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) - def serialize(self, keep_readonly=False, **kwargs): + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: """Return the JSON that would be sent to azure from this model. This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. @@ -339,8 +353,13 @@ def serialize(self, keep_readonly=False, **kwargs): serializer = Serializer(self._infer_class_models()) return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) - def as_dict(self, keep_readonly=True, key_transformer=attribute_transformer, **kwargs): - """Return a dict that can be JSONify using json.dump. + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. Advanced usage might optionally use a callback as parameter: @@ -387,7 +406,7 @@ def _infer_class_models(cls): return client_models @classmethod - def deserialize(cls, data, content_type=None): + def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. @@ -399,7 +418,12 @@ def deserialize(cls, data, content_type=None): return deserializer(cls.__name__, data, content_type=content_type) @classmethod - def from_dict(cls, data, key_extractors=None, content_type=None): + def from_dict( + cls: Type[ModelType], + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> ModelType: """Parse a dict using given key extractor return a model. By default consider key @@ -412,8 +436,8 @@ def from_dict(cls, data, key_extractors=None, content_type=None): :raises: DeserializationError if something went wrong """ deserializer = Deserializer(cls._infer_class_models()) - deserializer.key_extractors = ( - [ + deserializer.key_extractors = ( # type: ignore + [ # type: ignore attribute_key_case_insensitive_extractor, rest_key_case_insensitive_extractor, last_rest_key_case_insensitive_extractor, @@ -453,7 +477,7 @@ def _classify(cls, response, objects): return cls flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) try: - return objects[flatten_mapping_type[subtype_value]] + return objects[flatten_mapping_type[subtype_value]] # type: ignore except KeyError: _LOGGER.warning( "Subtype value %s has no mapping, use base class %s.", @@ -521,7 +545,7 @@ class Serializer(object): "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes=None): + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -537,7 +561,7 @@ def __init__(self, classes=None): "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies = dict(classes) if classes else {} + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True @@ -606,13 +630,13 @@ def _serialize(self, target_obj, data_type=None, **kwargs): if xml_ns: ET.register_namespace(xml_prefix, xml_ns) xml_name = "{}{}".format(xml_ns, xml_name) - serialized.set(xml_name, new_attr) + serialized.set(xml_name, new_attr) # type: ignore continue if xml_desc.get("text", False): - serialized.text = new_attr + serialized.text = new_attr # type: ignore continue if isinstance(new_attr, list): - serialized.extend(new_attr) + serialized.extend(new_attr) # type: ignore elif isinstance(new_attr, ET.Element): # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. if "name" not in getattr(orig_attr, "_xml_map", {}): @@ -621,23 +645,22 @@ def _serialize(self, target_obj, data_type=None, **kwargs): new_attr.tag = "}".join([splitted_tag[0], xml_name]) else: new_attr.tag = xml_name - serialized.append(new_attr) + serialized.append(new_attr) # type: ignore else: # That's a basic type # Integrate namespace if necessary local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) local_node.text = unicode_str(new_attr) - serialized.append(local_node) + serialized.append(local_node) # type: ignore else: # JSON - for k in reversed(keys): - unflattened = {k: new_attr} - new_attr = unflattened + for k in reversed(keys): # type: ignore + new_attr = {k: new_attr} _new_attr = new_attr _serialized = serialized - for k in keys: + for k in keys: # type: ignore if k not in _serialized: - _serialized.update(_new_attr) - _new_attr = _new_attr[k] + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] except ValueError: continue @@ -659,8 +682,8 @@ def body(self, data, data_type, **kwargs): """ # Just in case this is a dict - internal_data_type = data_type.strip("[]{}") - internal_data_type = self.dependencies.get(internal_data_type, None) + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) try: is_xml_model_serialization = kwargs["is_xml"] except KeyError: @@ -675,7 +698,7 @@ def body(self, data, data_type, **kwargs): # We're not able to deal with additional properties for now. deserializer.additional_properties_detection = False if is_xml_model_serialization: - deserializer.key_extractors = [ + deserializer.key_extractors = [ # type: ignore attribute_key_case_insensitive_extractor, ] else: @@ -780,6 +803,8 @@ def serialize_data(self, data, data_type, **kwargs): raise ValueError("No value for given attribute") try: + if data is AzureCoreNull: + return None if data_type in self.basic_types.values(): return self.serialize_basic(data, data_type, **kwargs) @@ -843,7 +868,7 @@ def serialize_unicode(cls, data): pass try: - if isinstance(data, unicode): + if isinstance(data, unicode): # type: ignore # Don't change it, JSON and XML ElementTree are totally able # to serialize correctly u'' strings return data @@ -1001,10 +1026,10 @@ def serialize_enum(attr, enum_obj=None): except AttributeError: result = attr try: - enum_obj(result) + enum_obj(result) # type: ignore return result except ValueError: - for enum_value in enum_obj: + for enum_value in enum_obj: # type: ignore if enum_value.value.lower() == str(attr).lower(): return enum_value.value error = "{!r} is not valid value for enum {!r}" @@ -1164,7 +1189,8 @@ def rest_key_extractor(attr, attr_desc, data): working_data = data while "." in key: - dict_keys = _FLATTEN.split(key) + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) break @@ -1335,7 +1361,7 @@ class Deserializer(object): valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes=None): + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1355,7 +1381,7 @@ def __init__(self, classes=None): "duration": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies = dict(classes) if classes else {} + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much @@ -1416,7 +1442,7 @@ def _deserialize(self, target_obj, data): if data is None: return data try: - attributes = response._attribute_map + attributes = response._attribute_map # type: ignore d_attrs = {} for attr, attr_desc in attributes.items(): # Check empty string. If it's not empty, someone has a real "additionalProperties"... @@ -1444,7 +1470,7 @@ def _deserialize(self, target_obj, data): value = self.deserialize_data(raw_value, attr_desc["type"]) d_attrs[attr] = value except (AttributeError, TypeError, KeyError) as err: - msg = "Unable to deserialize to object: " + class_name + msg = "Unable to deserialize to object: " + class_name # type: ignore raise_with_traceback(DeserializationError, msg, err) else: additional_properties = self._build_additional_properties(attributes, data) @@ -1474,7 +1500,7 @@ def _classify_target(self, target, data): Once classification has been determined, initialize object. :param str target: The target object type to deserialize to. - :param str/dict data: The response data to deseralize. + :param str/dict data: The response data to deserialize. """ if target is None: return None, None @@ -1489,7 +1515,7 @@ def _classify_target(self, target, data): target = target._classify(data, self.dependencies) except AttributeError: pass # Target is not a Model, no classify - return target, target.__class__.__name__ + return target, target.__class__.__name__ # type: ignore def failsafe_deserialize(self, target_obj, data, content_type=None): """Ignores any errors encountered in deserialization, @@ -1499,7 +1525,7 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): a deserialization error. :param str target_obj: The target object type to deserialize to. - :param str/dict data: The response data to deseralize. + :param str/dict data: The response data to deserialize. :param str content_type: Swagger "produces" if available. """ try: @@ -1543,7 +1569,7 @@ def _unpack_content(raw_data, content_type=None): return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) if isinstance(raw_data, (basestring, bytes)) or hasattr(raw_data, "read"): - return RawDeserializer.deserialize_from_text(raw_data, content_type) + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore return raw_data def _instantiate_model(self, response, attrs, additional_properties=None): @@ -1565,7 +1591,7 @@ def _instantiate_model(self, response, attrs, additional_properties=None): response_obj.additional_properties = additional_properties return response_obj except TypeError as err: - msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore raise DeserializationError(msg + str(err)) else: try: @@ -1747,7 +1773,7 @@ def deserialize_unicode(data): # Consider this is real string try: - if isinstance(data, unicode): + if isinstance(data, unicode): # type: ignore return data except NameError: return str(data) @@ -1798,7 +1824,7 @@ def deserialize_bytearray(attr): """ if isinstance(attr, ET.Element): attr = attr.text - return bytearray(b64decode(attr)) + return bytearray(b64decode(attr)) # type: ignore @staticmethod def deserialize_base64(attr): @@ -1810,8 +1836,8 @@ def deserialize_base64(attr): """ if isinstance(attr, ET.Element): attr = attr.text - padding = "=" * (3 - (len(attr) + 3) % 4) - attr = attr + padding + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore encoded = attr.replace("-", "+").replace("_", "/") return b64decode(encoded) @@ -1826,7 +1852,7 @@ def deserialize_decimal(attr): if isinstance(attr, ET.Element): attr = attr.text try: - return decimal.Decimal(attr) + return decimal.Decimal(attr) # type: ignore except decimal.DecimalException as err: msg = "Invalid decimal {}".format(attr) raise_with_traceback(DeserializationError, msg, err) @@ -1841,7 +1867,7 @@ def deserialize_long(attr): """ if isinstance(attr, ET.Element): attr = attr.text - return _long_type(attr) + return _long_type(attr) # type: ignore @staticmethod def deserialize_duration(attr): @@ -1871,7 +1897,7 @@ def deserialize_date(attr): """ if isinstance(attr, ET.Element): attr = attr.text - if re.search(r"[^\W\d_]", attr, re.I + re.U): + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore raise DeserializationError("Date must have only digits and -. Received: %s" % attr) # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. return isodate.parse_date(attr, defaultmonth=None, defaultday=None) @@ -1886,7 +1912,7 @@ def deserialize_time(attr): """ if isinstance(attr, ET.Element): attr = attr.text - if re.search(r"[^\W\d_]", attr, re.I + re.U): + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore raise DeserializationError("Date must have only digits and -. Received: %s" % attr) return isodate.parse_time(attr) @@ -1901,7 +1927,7 @@ def deserialize_rfc(attr): if isinstance(attr, ET.Element): attr = attr.text try: - parsed_date = email.utils.parsedate_tz(attr) + parsed_date = email.utils.parsedate_tz(attr) # type: ignore date_obj = datetime.datetime( *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) ) @@ -1924,7 +1950,7 @@ def deserialize_iso(attr): if isinstance(attr, ET.Element): attr = attr.text try: - attr = attr.upper() + attr = attr.upper() # type: ignore match = Deserializer.valid_date.match(attr) if not match: raise ValueError("Invalid datetime string: " + attr) @@ -1960,7 +1986,7 @@ def deserialize_unix(attr): :raises: DeserializationError if format invalid """ if isinstance(attr, ET.Element): - attr = int(attr.text) + attr = int(attr.text) # type: ignore try: date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) except ValueError as err: diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_vendor.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_vendor.py index 9aad73fc743e..bd0df84f5319 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_vendor.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_vendor.py @@ -5,6 +5,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import List, cast + from azure.core.pipeline.transport import HttpRequest @@ -22,6 +24,7 @@ def _format_url_section(template, **kwargs): try: return template.format(**kwargs) except KeyError as key: - formatted_components = template.split("/") + # Need the cast, as for some reasons "split" is typed as list[str | Any] + formatted_components = cast(List[str], template.split("/")) components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] template = "/".join(components) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_version.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_version.py index e25f4fc7373b..a712687790e5 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 = "9.0.0b2" +VERSION = "0.7.0" diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/__init__.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/__init__.py index ac5eb24b55c8..0ec156d96fb5 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/__init__.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk 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 dc12448cd980..0652c4ee0fb2 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 @@ -35,14 +35,14 @@ class CosmosDBManagementClientConfiguration(Configuration): # pylint: disable=t :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-08-15-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2022-11-15-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(CosmosDBManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-08-15-preview") # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop("api_version", "2022-11-15-preview") 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 4fa2888ba9cb..58b601d161d8 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 @@ -12,12 +12,13 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from .._serialization import Deserializer, Serializer from ._configuration import CosmosDBManagementClientConfiguration from .operations import ( CassandraClustersOperations, CassandraDataCentersOperations, + CassandraRepairOperations, CassandraResourcesOperations, CollectionOperations, CollectionPartitionOperations, @@ -117,6 +118,8 @@ class CosmosDBManagementClient: # pylint: disable=client-accepts-api-version-ke :ivar cassandra_data_centers: CassandraDataCentersOperations operations :vartype cassandra_data_centers: azure.mgmt.cosmosdb.aio.operations.CassandraDataCentersOperations + :ivar cassandra_repair: CassandraRepairOperations operations + :vartype cassandra_repair: azure.mgmt.cosmosdb.aio.operations.CassandraRepairOperations :ivar notebook_workspaces: NotebookWorkspacesOperations operations :vartype notebook_workspaces: azure.mgmt.cosmosdb.aio.operations.NotebookWorkspacesOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations @@ -168,7 +171,7 @@ class CosmosDBManagementClient: # pylint: disable=client-accepts-api-version-ke :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2022-08-15-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2022-11-15-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no @@ -187,7 +190,7 @@ def __init__( ) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -244,6 +247,9 @@ def __init__( self.cassandra_data_centers = CassandraDataCentersOperations( self._client, self._config, self._serialize, self._deserialize ) + self.cassandra_repair = CassandraRepairOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.notebook_workspaces = NotebookWorkspacesOperations( self._client, self._config, self._serialize, self._deserialize ) 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 b9aee75bbc64..793e28754919 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 @@ -29,6 +29,7 @@ from ._data_transfer_jobs_operations import DataTransferJobsOperations from ._cassandra_clusters_operations import CassandraClustersOperations from ._cassandra_data_centers_operations import CassandraDataCentersOperations +from ._cassandra_repair_operations import CassandraRepairOperations from ._notebook_workspaces_operations import NotebookWorkspacesOperations from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations from ._private_link_resources_operations import PrivateLinkResourcesOperations @@ -47,7 +48,7 @@ from ._service_operations import ServiceOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -74,6 +75,7 @@ "DataTransferJobsOperations", "CassandraClustersOperations", "CassandraDataCentersOperations", + "CassandraRepairOperations", "NotebookWorkspacesOperations", "PrivateEndpointConnectionsOperations", "PrivateLinkResourcesOperations", 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 1345e60701d6..2e4133a4ff6a 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 @@ -35,10 +35,8 @@ build_create_update_request, build_deallocate_request, build_delete_request, - build_get_backup_request, build_get_request, build_invoke_command_request, - build_list_backups_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_start_request, @@ -85,10 +83,10 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ClusterR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ListClusters] + ) + cls: ClsType[_models.ListClusters] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -109,7 +107,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -125,7 +123,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -133,13 +131,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ListClusters", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -152,7 +150,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/cassandraClusters"} # type: ignore + list_by_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/cassandraClusters" + } @distributed_trace def list_by_resource_group( @@ -171,10 +171,10 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ListClusters] + ) + cls: ClsType[_models.ListClusters] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -196,7 +196,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -212,7 +212,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -220,13 +220,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ListClusters", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -239,7 +239,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters" + } @distributed_trace_async async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.ClusterResource: @@ -266,10 +268,10 @@ async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterResource] + ) + cls: ClsType[_models.ClusterResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -281,9 +283,9 @@ async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -300,7 +302,9 @@ async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, **kwargs: Any @@ -316,10 +320,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -331,9 +335,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -346,7 +350,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } @distributed_trace_async async def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -372,13 +378,13 @@ async def begin_delete(self, resource_group_name: str, cluster_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -396,7 +402,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -408,9 +414,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } async def _create_update_initial( self, resource_group_name: str, cluster_name: str, body: Union[_models.ClusterResource, IO], **kwargs: Any @@ -426,11 +434,11 @@ async def _create_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ClusterResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -453,9 +461,9 @@ async def _create_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -472,11 +480,13 @@ async def _create_update_initial( deserialized = self._deserialize("ClusterResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _create_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + _create_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } @overload async def begin_create_update( @@ -588,16 +598,16 @@ async def begin_create_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterResource] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ClusterResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_initial( # type: ignore + raw_result = await self._create_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, body=body, @@ -617,7 +627,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -629,9 +639,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + begin_create_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } async def _update_initial( self, resource_group_name: str, cluster_name: str, body: Union[_models.ClusterResource, IO], **kwargs: Any @@ -647,11 +659,11 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ClusterResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -674,9 +686,9 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -693,11 +705,13 @@ async def _update_initial( deserialized = self._deserialize("ClusterResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } @overload async def begin_update( @@ -804,16 +818,16 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterResource] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ClusterResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + raw_result = await self._update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, body=body, @@ -833,7 +847,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -845,9 +859,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } async def _invoke_command_initial( self, resource_group_name: str, cluster_name: str, body: Union[_models.CommandPostBody, IO], **kwargs: Any @@ -863,11 +879,11 @@ async def _invoke_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CommandOutput] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CommandOutput] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -890,9 +906,9 @@ async def _invoke_command_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -909,7 +925,9 @@ async def _invoke_command_initial( return deserialized - _invoke_command_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/invokeCommand"} # type: ignore + _invoke_command_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/invokeCommand" + } @overload async def begin_invoke_command( @@ -1016,16 +1034,16 @@ async def begin_invoke_command( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CommandOutput] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CommandOutput] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._invoke_command_initial( # type: ignore + raw_result = await self._invoke_command_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, body=body, @@ -1045,7 +1063,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1057,165 +1075,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_invoke_command.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/invokeCommand"} # 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :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 {}) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ListBackups] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_backups_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_backups.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - 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) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_backups.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups"} # type: ignore - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: BackupResource or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.BackupResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupResource] - - 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, - template_url=self.get_backup.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("BackupResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_backup.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups/{backupId}"} # type: ignore + begin_invoke_command.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/invokeCommand" + } async def _deallocate_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, **kwargs: Any @@ -1231,10 +1095,10 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_deallocate_request( resource_group_name=resource_group_name, @@ -1246,9 +1110,9 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1261,7 +1125,9 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _deallocate_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate"} # type: ignore + _deallocate_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate" + } @distributed_trace_async async def begin_deallocate( @@ -1291,13 +1157,13 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._deallocate_initial( # type: ignore resource_group_name=resource_group_name, @@ -1315,7 +1181,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1327,9 +1193,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_deallocate.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate"} # type: ignore + begin_deallocate.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate" + } async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, **kwargs: Any @@ -1345,10 +1213,10 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_start_request( resource_group_name=resource_group_name, @@ -1360,9 +1228,9 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1375,7 +1243,9 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/start"} # type: ignore + _start_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/start" + } @distributed_trace_async async def begin_start(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -1403,13 +1273,13 @@ async def begin_start(self, resource_group_name: str, cluster_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._start_initial( # type: ignore resource_group_name=resource_group_name, @@ -1427,7 +1297,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1439,9 +1309,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/start"} # type: ignore + begin_start.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/start" + } @distributed_trace_async async def status( @@ -1470,10 +1342,10 @@ async def status( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraClusterPublicStatus] + ) + cls: ClsType[_models.CassandraClusterPublicStatus] = kwargs.pop("cls", None) request = build_status_request( resource_group_name=resource_group_name, @@ -1485,9 +1357,9 @@ async def status( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1504,4 +1376,6 @@ async def status( return deserialized - status.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/status"} # type: ignore + status.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/status" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_data_centers_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_data_centers_operations.py index 1a98c919d8ad..f8c863480725 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_data_centers_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_data_centers_operations.py @@ -85,10 +85,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ListDataCenters] + ) + cls: ClsType[_models.ListDataCenters] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -111,7 +111,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -127,7 +127,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -135,13 +135,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ListDataCenters", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -154,7 +154,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters" + } @distributed_trace_async async def get( @@ -185,10 +187,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataCenterResource] + ) + cls: ClsType[_models.DataCenterResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -201,9 +203,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -220,7 +222,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, data_center_name: str, **kwargs: Any @@ -236,10 +240,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -252,9 +256,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -267,7 +271,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } @distributed_trace_async async def begin_delete( @@ -297,13 +303,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -322,7 +328,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -334,9 +340,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } async def _create_update_initial( self, @@ -357,11 +365,11 @@ async def _create_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataCenterResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DataCenterResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -385,9 +393,9 @@ async def _create_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -404,11 +412,13 @@ async def _create_update_initial( deserialized = self._deserialize("DataCenterResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _create_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + _create_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } @overload async def begin_create_update( @@ -531,16 +541,16 @@ async def begin_create_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataCenterResource] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DataCenterResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_initial( # type: ignore + raw_result = await self._create_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, data_center_name=data_center_name, @@ -561,7 +571,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -573,9 +583,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + begin_create_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } async def _update_initial( self, @@ -596,11 +608,11 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataCenterResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DataCenterResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -624,9 +636,9 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -643,11 +655,13 @@ async def _update_initial( deserialized = self._deserialize("DataCenterResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } @overload async def begin_update( @@ -767,16 +781,16 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataCenterResource] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DataCenterResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + raw_result = await self._update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, data_center_name=data_center_name, @@ -797,7 +811,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -809,6 +823,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_repair_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_repair_operations.py new file mode 100644 index 000000000000..2c424397b828 --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_repair_operations.py @@ -0,0 +1,1639 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._cassandra_repair_operations import ( + build_abort_segment_request, + build_create_request, + build_delete_request, + build_get_cluster_status_request, + build_get_table_status_request, + build_list_request, + build_list_segments_request, + build_pause_request, + build_resume_request, + build_show_request, + build_update_request, +) + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class CassandraRepairOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.cosmosdb.aio.CosmosDBManagementClient`'s + :attr:`cassandra_repair` 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") + + async def _get_cluster_status_initial( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> _models.CassandraReaperClusterStatus: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.CassandraReaperClusterStatus] = kwargs.pop("cls", None) + + request = build_get_cluster_status_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._get_cluster_status_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CassandraReaperClusterStatus", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _get_cluster_status_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairStatus" + } + + @distributed_trace_async + async def begin_get_cluster_status( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.CassandraReaperClusterStatus]: + """get_cluster_status. + + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either CassandraReaperClusterStatus or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.CassandraReaperClusterStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.CassandraReaperClusterStatus] = 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._get_cluster_status_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("CassandraReaperClusterStatus", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_get_cluster_status.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairStatus" + } + + async def _get_table_status_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> str: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[str] = kwargs.pop("cls", None) + + request = build_get_table_status_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._get_table_status_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _get_table_status_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairTables" + } + + @distributed_trace_async + async def begin_get_table_status( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncLROPoller[str]: + """get_table_status. + + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[str] = 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._get_table_status_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_get_table_status.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairTables" + } + + async def _create_initial( + self, + resource_group_name: str, + cluster_name: str, + body: Union[_models.CassandraClusterRepairPublicResource, IO], + **kwargs: Any + ) -> _models.CassandraReaperRunStatus: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_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.CassandraReaperRunStatus] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IO, bytes)): + _content = body + else: + _json = self._serialize.body(body, "CassandraClusterRepairPublicResource") + + request = build_create_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, + template_url=self._create_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CassandraReaperRunStatus", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns" + } + + @overload + async def begin_create( + self, + resource_group_name: str, + cluster_name: str, + body: _models.CassandraClusterRepairPublicResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CassandraReaperRunStatus]: + """create. + + :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: The properties specifying the desired state of repairRun to be created. Required. + :type body: ~azure.mgmt.cosmosdb.models.CassandraClusterRepairPublicResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either CassandraReaperRunStatus or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.CassandraReaperRunStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + cluster_name: str, + body: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CassandraReaperRunStatus]: + """create. + + :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: The properties specifying the desired state of repairRun to be created. Required. + :type body: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either CassandraReaperRunStatus or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.CassandraReaperRunStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + cluster_name: str, + body: Union[_models.CassandraClusterRepairPublicResource, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.CassandraReaperRunStatus]: + """create. + + :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: The properties specifying the desired state of repairRun to be created. Is either + a model type or a IO type. Required. + :type body: ~azure.mgmt.cosmosdb.models.CassandraClusterRepairPublicResource or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either CassandraReaperRunStatus or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.CassandraReaperRunStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_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.CassandraReaperRunStatus] = 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, + 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 + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("CassandraReaperRunStatus", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns" + } + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, cluster_name: str, repair_run_id: str, owner_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + owner_name=owner_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/owner/{ownerName}" + } + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, cluster_name: str, repair_run_id: str, owner_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """delete. + + :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 repair_run_id: Id of repair run created to repair Cassandra cluster. Required. + :type repair_run_id: str + :param owner_name: Owner Name that was used to create the Repair Run. Required. + :type owner_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + owner_name=owner_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/owner/{ownerName}" + } + + async def _list_initial( + self, + resource_group_name: str, + cluster_name: str, + body: Optional[Union[_models.CassandraClusterRepairListFilter, IO]] = None, + **kwargs: Any + ) -> _models.CassandraReaperRunStatusFeedResponse: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_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.CassandraReaperRunStatusFeedResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IO, bytes)): + _content = body + else: + if body is not None: + _json = self._serialize.body(body, "CassandraClusterRepairListFilter") + else: + _json = None + + request = build_list_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, + template_url=self._list_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CassandraReaperRunStatusFeedResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _list_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/list" + } + + @overload + async def begin_list( + self, + resource_group_name: str, + cluster_name: str, + body: Optional[_models.CassandraClusterRepairListFilter] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CassandraReaperRunStatusFeedResponse]: + """list. + + :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: Optional filter parameters to list repairs. Default value is None. + :type body: ~azure.mgmt.cosmosdb.models.CassandraClusterRepairListFilter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either CassandraReaperRunStatusFeedResponse + or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.CassandraReaperRunStatusFeedResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_list( + self, + resource_group_name: str, + cluster_name: str, + body: Optional[IO] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CassandraReaperRunStatusFeedResponse]: + """list. + + :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: Optional filter parameters to list repairs. Default value is None. + :type body: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either CassandraReaperRunStatusFeedResponse + or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.CassandraReaperRunStatusFeedResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_list( + self, + resource_group_name: str, + cluster_name: str, + body: Optional[Union[_models.CassandraClusterRepairListFilter, IO]] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.CassandraReaperRunStatusFeedResponse]: + """list. + + :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: Optional filter parameters to list repairs. Is either a model type or a IO type. + Default value is None. + :type body: ~azure.mgmt.cosmosdb.models.CassandraClusterRepairListFilter or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either CassandraReaperRunStatusFeedResponse + or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.CassandraReaperRunStatusFeedResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_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.CassandraReaperRunStatusFeedResponse] = 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_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 + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("CassandraReaperRunStatusFeedResponse", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/list" + } + + async def _pause_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, cluster_name: str, repair_run_id: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_pause_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._pause_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _pause_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/pause" + } + + @distributed_trace_async + async def begin_pause( + self, resource_group_name: str, cluster_name: str, repair_run_id: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """pause. + + :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 repair_run_id: Id of repair run created to repair Cassandra cluster. Required. + :type repair_run_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = 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._pause_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_pause.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/pause" + } + + async def _resume_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, cluster_name: str, repair_run_id: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_resume_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._resume_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _resume_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/resume" + } + + @distributed_trace_async + async def begin_resume( + self, resource_group_name: str, cluster_name: str, repair_run_id: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """resume. + + :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 repair_run_id: Id of repair run created to repair Cassandra cluster. Required. + :type repair_run_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = 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._resume_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_resume.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/resume" + } + + async def _list_segments_initial( + self, resource_group_name: str, cluster_name: str, repair_run_id: str, **kwargs: Any + ) -> _models.CassandraRepairSegmentResourceFeedResponse: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.CassandraRepairSegmentResourceFeedResponse] = kwargs.pop("cls", None) + + request = build_list_segments_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._list_segments_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CassandraRepairSegmentResourceFeedResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _list_segments_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/segments" + } + + @distributed_trace_async + async def begin_list_segments( + self, resource_group_name: str, cluster_name: str, repair_run_id: str, **kwargs: Any + ) -> AsyncLROPoller[_models.CassandraRepairSegmentResourceFeedResponse]: + """list_segments. + + :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 repair_run_id: Id of repair run created to repair Cassandra cluster. Required. + :type repair_run_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either + CassandraRepairSegmentResourceFeedResponse or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.CassandraRepairSegmentResourceFeedResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.CassandraRepairSegmentResourceFeedResponse] = 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_segments_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("CassandraRepairSegmentResourceFeedResponse", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_list_segments.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/segments" + } + + async def _show_initial( + self, resource_group_name: str, cluster_name: str, repair_run_id: str, **kwargs: Any + ) -> _models.CassandraReaperRunStatus: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.CassandraReaperRunStatus] = kwargs.pop("cls", None) + + request = build_show_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._show_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CassandraReaperRunStatus", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _show_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/show" + } + + @distributed_trace_async + async def begin_show( + self, resource_group_name: str, cluster_name: str, repair_run_id: str, **kwargs: Any + ) -> AsyncLROPoller[_models.CassandraReaperRunStatus]: + """show. + + :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 repair_run_id: Id of repair run created to repair Cassandra cluster. Required. + :type repair_run_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either CassandraReaperRunStatus or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.CassandraReaperRunStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.CassandraReaperRunStatus] = 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._show_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("CassandraReaperRunStatus", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_show.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/show" + } + + async def _abort_segment_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, cluster_name: str, repair_run_id: str, segment_id: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_abort_segment_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + segment_id=segment_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._abort_segment_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _abort_segment_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/segments/{segmentId}/abort" + } + + @distributed_trace_async + async def begin_abort_segment( + self, resource_group_name: str, cluster_name: str, repair_run_id: str, segment_id: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """abort_segment. + + :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 repair_run_id: Id of repair run created to repair Cassandra cluster. Required. + :type repair_run_id: str + :param segment_id: Id of a segment of a repair run. Required. + :type segment_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = 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._abort_segment_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + segment_id=segment_id, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_abort_segment.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/segments/{segmentId}/abort" + } + + async def _update_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, cluster_name: str, repair_run_id: str, intensity_value: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_update_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + intensity_value=intensity_value, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._update_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/intensity/{intensityValue}" + } + + @distributed_trace_async + async def begin_update( + self, resource_group_name: str, cluster_name: str, repair_run_id: str, intensity_value: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """update. + + :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 repair_run_id: Id of repair run created to repair Cassandra cluster. Required. + :type repair_run_id: str + :param intensity_value: Floating point value representing intensity of the repair. Required. + :type intensity_value: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = 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._update_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + intensity_value=intensity_value, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/intensity/{intensityValue}" + } 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 3dcb19e46c16..83aa19571d6e 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 @@ -106,10 +106,10 @@ def list_cassandra_keyspaces( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraKeyspaceListResult] + ) + cls: ClsType[_models.CassandraKeyspaceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -132,7 +132,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -148,7 +148,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -156,13 +156,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("CassandraKeyspaceListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -175,7 +175,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_cassandra_keyspaces.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces"} # type: ignore + list_cassandra_keyspaces.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces" + } @distributed_trace_async async def get_cassandra_keyspace( @@ -207,10 +209,10 @@ async def get_cassandra_keyspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraKeyspaceGetResults] + ) + cls: ClsType[_models.CassandraKeyspaceGetResults] = kwargs.pop("cls", None) request = build_get_cassandra_keyspace_request( resource_group_name=resource_group_name, @@ -223,9 +225,9 @@ async def get_cassandra_keyspace( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -242,7 +244,9 @@ async def get_cassandra_keyspace( return deserialized - get_cassandra_keyspace.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}"} # type: ignore + get_cassandra_keyspace.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}" + } async def _create_update_cassandra_keyspace_initial( self, @@ -263,11 +267,11 @@ async def _create_update_cassandra_keyspace_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CassandraKeyspaceGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.CassandraKeyspaceGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -293,9 +297,9 @@ async def _create_update_cassandra_keyspace_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -314,7 +318,9 @@ async def _create_update_cassandra_keyspace_initial( return deserialized - _create_update_cassandra_keyspace_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}"} # type: ignore + _create_update_cassandra_keyspace_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}" + } @overload async def begin_create_update_cassandra_keyspace( @@ -441,16 +447,16 @@ async def begin_create_update_cassandra_keyspace( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraKeyspaceGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CassandraKeyspaceGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_cassandra_keyspace_initial( # type: ignore + raw_result = await self._create_update_cassandra_keyspace_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -471,7 +477,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -483,9 +489,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_cassandra_keyspace.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}"} # type: ignore + begin_create_update_cassandra_keyspace.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}" + } async def _delete_cassandra_keyspace_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any @@ -501,10 +509,10 @@ async def _delete_cassandra_keyspace_initial( # pylint: disable=inconsistent-re _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_cassandra_keyspace_request( resource_group_name=resource_group_name, @@ -517,9 +525,9 @@ async def _delete_cassandra_keyspace_initial( # pylint: disable=inconsistent-re params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -532,7 +540,9 @@ async def _delete_cassandra_keyspace_initial( # pylint: disable=inconsistent-re if cls: return cls(pipeline_response, None, {}) - _delete_cassandra_keyspace_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}"} # type: ignore + _delete_cassandra_keyspace_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}" + } @distributed_trace_async async def begin_delete_cassandra_keyspace( @@ -562,13 +572,13 @@ async def begin_delete_cassandra_keyspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_cassandra_keyspace_initial( # type: ignore resource_group_name=resource_group_name, @@ -587,7 +597,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -599,9 +609,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_cassandra_keyspace.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}"} # type: ignore + begin_delete_cassandra_keyspace.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}" + } @distributed_trace_async async def get_cassandra_keyspace_throughput( @@ -633,10 +645,10 @@ async def get_cassandra_keyspace_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_cassandra_keyspace_throughput_request( resource_group_name=resource_group_name, @@ -649,9 +661,9 @@ async def get_cassandra_keyspace_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -668,7 +680,9 @@ async def get_cassandra_keyspace_throughput( return deserialized - get_cassandra_keyspace_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default"} # type: ignore + get_cassandra_keyspace_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default" + } async def _update_cassandra_keyspace_throughput_initial( self, @@ -689,11 +703,11 @@ async def _update_cassandra_keyspace_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -717,9 +731,9 @@ async def _update_cassandra_keyspace_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -738,7 +752,9 @@ async def _update_cassandra_keyspace_throughput_initial( return deserialized - _update_cassandra_keyspace_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default"} # type: ignore + _update_cassandra_keyspace_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default" + } @overload async def begin_update_cassandra_keyspace_throughput( @@ -865,16 +881,16 @@ async def begin_update_cassandra_keyspace_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_cassandra_keyspace_throughput_initial( # type: ignore + raw_result = await self._update_cassandra_keyspace_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -895,7 +911,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -907,9 +923,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_cassandra_keyspace_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default"} # type: ignore + begin_update_cassandra_keyspace_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default" + } async def _migrate_cassandra_keyspace_to_autoscale_initial( self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any @@ -925,10 +943,10 @@ async def _migrate_cassandra_keyspace_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_cassandra_keyspace_to_autoscale_request( resource_group_name=resource_group_name, @@ -941,9 +959,9 @@ async def _migrate_cassandra_keyspace_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -962,7 +980,9 @@ async def _migrate_cassandra_keyspace_to_autoscale_initial( return deserialized - _migrate_cassandra_keyspace_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_cassandra_keyspace_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace_async async def begin_migrate_cassandra_keyspace_to_autoscale( @@ -994,15 +1014,15 @@ async def begin_migrate_cassandra_keyspace_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_cassandra_keyspace_to_autoscale_initial( # type: ignore + raw_result = await self._migrate_cassandra_keyspace_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -1021,7 +1041,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1033,9 +1053,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_cassandra_keyspace_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_cassandra_keyspace_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale" + } async def _migrate_cassandra_keyspace_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any @@ -1051,10 +1073,10 @@ async def _migrate_cassandra_keyspace_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_cassandra_keyspace_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -1067,9 +1089,9 @@ async def _migrate_cassandra_keyspace_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1088,7 +1110,9 @@ async def _migrate_cassandra_keyspace_to_manual_throughput_initial( return deserialized - _migrate_cassandra_keyspace_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_cassandra_keyspace_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace_async async def begin_migrate_cassandra_keyspace_to_manual_throughput( @@ -1120,15 +1144,15 @@ async def begin_migrate_cassandra_keyspace_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_cassandra_keyspace_to_manual_throughput_initial( # type: ignore + raw_result = await self._migrate_cassandra_keyspace_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -1147,7 +1171,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1159,9 +1183,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_cassandra_keyspace_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_cassandra_keyspace_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def list_cassandra_tables( @@ -1186,10 +1212,10 @@ def list_cassandra_tables( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraTableListResult] + ) + cls: ClsType[_models.CassandraTableListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1213,7 +1239,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -1229,7 +1255,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1237,13 +1263,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("CassandraTableListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1256,7 +1282,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_cassandra_tables.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables"} # type: ignore + list_cassandra_tables.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables" + } @distributed_trace_async async def get_cassandra_table( @@ -1289,10 +1317,10 @@ async def get_cassandra_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraTableGetResults] + ) + cls: ClsType[_models.CassandraTableGetResults] = kwargs.pop("cls", None) request = build_get_cassandra_table_request( resource_group_name=resource_group_name, @@ -1306,9 +1334,9 @@ async def get_cassandra_table( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1325,7 +1353,9 @@ async def get_cassandra_table( return deserialized - get_cassandra_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}"} # type: ignore + get_cassandra_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}" + } async def _create_update_cassandra_table_initial( self, @@ -1347,11 +1377,11 @@ async def _create_update_cassandra_table_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CassandraTableGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.CassandraTableGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1378,9 +1408,9 @@ async def _create_update_cassandra_table_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1399,7 +1429,9 @@ async def _create_update_cassandra_table_initial( return deserialized - _create_update_cassandra_table_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}"} # type: ignore + _create_update_cassandra_table_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}" + } @overload async def begin_create_update_cassandra_table( @@ -1535,16 +1567,16 @@ async def begin_create_update_cassandra_table( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraTableGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CassandraTableGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_cassandra_table_initial( # type: ignore + raw_result = await self._create_update_cassandra_table_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -1566,7 +1598,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1578,9 +1610,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_cassandra_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}"} # type: ignore + begin_create_update_cassandra_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}" + } async def _delete_cassandra_table_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any @@ -1596,10 +1630,10 @@ async def _delete_cassandra_table_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_cassandra_table_request( resource_group_name=resource_group_name, @@ -1613,9 +1647,9 @@ async def _delete_cassandra_table_initial( # pylint: disable=inconsistent-retur params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1628,7 +1662,9 @@ async def _delete_cassandra_table_initial( # pylint: disable=inconsistent-retur if cls: return cls(pipeline_response, None, {}) - _delete_cassandra_table_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}"} # type: ignore + _delete_cassandra_table_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}" + } @distributed_trace_async async def begin_delete_cassandra_table( @@ -1660,13 +1696,13 @@ async def begin_delete_cassandra_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_cassandra_table_initial( # type: ignore resource_group_name=resource_group_name, @@ -1686,7 +1722,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1698,9 +1734,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_cassandra_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}"} # type: ignore + begin_delete_cassandra_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}" + } @distributed_trace_async async def get_cassandra_table_throughput( @@ -1734,10 +1772,10 @@ async def get_cassandra_table_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_cassandra_table_throughput_request( resource_group_name=resource_group_name, @@ -1751,9 +1789,9 @@ async def get_cassandra_table_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1770,7 +1808,9 @@ async def get_cassandra_table_throughput( return deserialized - get_cassandra_table_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default"} # type: ignore + get_cassandra_table_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default" + } async def _update_cassandra_table_throughput_initial( self, @@ -1792,11 +1832,11 @@ async def _update_cassandra_table_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1821,9 +1861,9 @@ async def _update_cassandra_table_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1842,7 +1882,9 @@ async def _update_cassandra_table_throughput_initial( return deserialized - _update_cassandra_table_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default"} # type: ignore + _update_cassandra_table_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default" + } @overload async def begin_update_cassandra_table_throughput( @@ -1978,16 +2020,16 @@ async def begin_update_cassandra_table_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_cassandra_table_throughput_initial( # type: ignore + raw_result = await self._update_cassandra_table_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -2009,7 +2051,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2021,9 +2063,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_cassandra_table_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default"} # type: ignore + begin_update_cassandra_table_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default" + } async def _migrate_cassandra_table_to_autoscale_initial( self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any @@ -2039,10 +2083,10 @@ async def _migrate_cassandra_table_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_cassandra_table_to_autoscale_request( resource_group_name=resource_group_name, @@ -2056,9 +2100,9 @@ async def _migrate_cassandra_table_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2077,7 +2121,9 @@ async def _migrate_cassandra_table_to_autoscale_initial( return deserialized - _migrate_cassandra_table_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_cassandra_table_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace_async async def begin_migrate_cassandra_table_to_autoscale( @@ -2111,15 +2157,15 @@ async def begin_migrate_cassandra_table_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_cassandra_table_to_autoscale_initial( # type: ignore + raw_result = await self._migrate_cassandra_table_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -2139,7 +2185,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2151,9 +2197,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_cassandra_table_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_cassandra_table_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale" + } async def _migrate_cassandra_table_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any @@ -2169,10 +2217,10 @@ async def _migrate_cassandra_table_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_cassandra_table_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -2186,9 +2234,9 @@ async def _migrate_cassandra_table_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2207,7 +2255,9 @@ async def _migrate_cassandra_table_to_manual_throughput_initial( return deserialized - _migrate_cassandra_table_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_cassandra_table_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace_async async def begin_migrate_cassandra_table_to_manual_throughput( @@ -2241,15 +2291,15 @@ async def begin_migrate_cassandra_table_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_cassandra_table_to_manual_throughput_initial( # type: ignore + raw_result = await self._migrate_cassandra_table_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -2269,7 +2319,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2281,9 +2331,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_cassandra_table_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_cassandra_table_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def list_cassandra_views( @@ -2308,10 +2360,10 @@ def list_cassandra_views( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraViewListResult] + ) + cls: ClsType[_models.CassandraViewListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2335,7 +2387,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -2351,7 +2403,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2359,13 +2411,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2378,7 +2430,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_cassandra_views.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views"} # type: ignore + list_cassandra_views.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views" + } @distributed_trace_async async def get_cassandra_view( @@ -2411,10 +2465,10 @@ async def get_cassandra_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraViewGetResults] + ) + cls: ClsType[_models.CassandraViewGetResults] = kwargs.pop("cls", None) request = build_get_cassandra_view_request( resource_group_name=resource_group_name, @@ -2428,9 +2482,9 @@ async def get_cassandra_view( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2447,7 +2501,9 @@ async def get_cassandra_view( return deserialized - get_cassandra_view.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}"} # type: ignore + get_cassandra_view.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}" + } async def _create_update_cassandra_view_initial( self, @@ -2469,11 +2525,11 @@ async def _create_update_cassandra_view_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CassandraViewGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.CassandraViewGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2498,9 +2554,9 @@ async def _create_update_cassandra_view_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2519,7 +2575,9 @@ async def _create_update_cassandra_view_initial( return deserialized - _create_update_cassandra_view_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}"} # type: ignore + _create_update_cassandra_view_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}" + } @overload async def begin_create_update_cassandra_view( @@ -2652,16 +2710,16 @@ async def begin_create_update_cassandra_view( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraViewGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_cassandra_view_initial( # type: ignore + raw_result = await self._create_update_cassandra_view_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -2683,7 +2741,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2695,9 +2753,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_cassandra_view.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}"} # type: ignore + begin_create_update_cassandra_view.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}" + } async def _delete_cassandra_view_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any @@ -2713,10 +2773,10 @@ async def _delete_cassandra_view_initial( # pylint: disable=inconsistent-return _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_cassandra_view_request( resource_group_name=resource_group_name, @@ -2730,9 +2790,9 @@ async def _delete_cassandra_view_initial( # pylint: disable=inconsistent-return params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2745,7 +2805,9 @@ async def _delete_cassandra_view_initial( # pylint: disable=inconsistent-return if cls: return cls(pipeline_response, None, {}) - _delete_cassandra_view_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}"} # type: ignore + _delete_cassandra_view_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}" + } @distributed_trace_async async def begin_delete_cassandra_view( @@ -2777,13 +2839,13 @@ async def begin_delete_cassandra_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_cassandra_view_initial( # type: ignore resource_group_name=resource_group_name, @@ -2803,7 +2865,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2815,9 +2877,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_cassandra_view.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}"} # type: ignore + begin_delete_cassandra_view.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}" + } @distributed_trace_async async def get_cassandra_view_throughput( @@ -2851,10 +2915,10 @@ async def get_cassandra_view_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_cassandra_view_throughput_request( resource_group_name=resource_group_name, @@ -2868,9 +2932,9 @@ async def get_cassandra_view_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2887,7 +2951,9 @@ async def get_cassandra_view_throughput( return deserialized - get_cassandra_view_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default"} # type: ignore + get_cassandra_view_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default" + } async def _update_cassandra_view_throughput_initial( self, @@ -2909,11 +2975,11 @@ async def _update_cassandra_view_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2938,9 +3004,9 @@ async def _update_cassandra_view_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2959,7 +3025,9 @@ async def _update_cassandra_view_throughput_initial( return deserialized - _update_cassandra_view_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default"} # type: ignore + _update_cassandra_view_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default" + } @overload async def begin_update_cassandra_view_throughput( @@ -3095,16 +3163,16 @@ async def begin_update_cassandra_view_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_cassandra_view_throughput_initial( # type: ignore + raw_result = await self._update_cassandra_view_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -3126,7 +3194,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3138,9 +3206,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_cassandra_view_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default"} # type: ignore + begin_update_cassandra_view_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default" + } async def _migrate_cassandra_view_to_autoscale_initial( self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any @@ -3156,10 +3226,10 @@ async def _migrate_cassandra_view_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_cassandra_view_to_autoscale_request( resource_group_name=resource_group_name, @@ -3173,9 +3243,9 @@ async def _migrate_cassandra_view_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3194,7 +3264,9 @@ async def _migrate_cassandra_view_to_autoscale_initial( return deserialized - _migrate_cassandra_view_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_cassandra_view_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace_async async def begin_migrate_cassandra_view_to_autoscale( @@ -3228,15 +3300,15 @@ async def begin_migrate_cassandra_view_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_cassandra_view_to_autoscale_initial( # type: ignore + raw_result = await self._migrate_cassandra_view_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -3256,7 +3328,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3268,9 +3340,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_cassandra_view_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_cassandra_view_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale" + } async def _migrate_cassandra_view_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any @@ -3286,10 +3360,10 @@ async def _migrate_cassandra_view_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_cassandra_view_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -3303,9 +3377,9 @@ async def _migrate_cassandra_view_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3324,7 +3398,9 @@ async def _migrate_cassandra_view_to_manual_throughput_initial( return deserialized - _migrate_cassandra_view_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_cassandra_view_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace_async async def begin_migrate_cassandra_view_to_manual_throughput( @@ -3358,15 +3434,15 @@ async def begin_migrate_cassandra_view_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + 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( # type: ignore + 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, @@ -3386,7 +3462,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3398,6 +3474,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_cassandra_view_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_cassandra_view_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_operations.py index 7c431c7d5954..b87d9195e421 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_operations.py @@ -95,10 +95,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + ) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -124,7 +124,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -140,7 +140,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -148,13 +148,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("MetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -167,7 +167,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metrics" + } @distributed_trace def list_usages( @@ -202,10 +204,10 @@ def list_usages( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.UsagesResult] + ) + cls: ClsType[_models.UsagesResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -231,7 +233,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -247,7 +249,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -255,13 +257,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("UsagesResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -274,7 +276,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_usages.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/usages"} # type: ignore + list_usages.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/usages" + } @distributed_trace def list_metric_definitions( @@ -299,10 +303,10 @@ def list_metric_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricDefinitionsListResult] + ) + cls: ClsType[_models.MetricDefinitionsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -327,7 +331,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -343,7 +347,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -351,13 +355,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("MetricDefinitionsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -370,4 +374,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metric_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metricDefinitions"} # type: ignore + list_metric_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metricDefinitions" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_partition_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_partition_operations.py index 8f260e154590..057ac7c2fb36 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_partition_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_partition_operations.py @@ -91,10 +91,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PartitionMetricListResult] + ) + cls: ClsType[_models.PartitionMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -120,7 +120,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -136,7 +136,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -144,13 +144,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("PartitionMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -163,7 +163,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics" + } @distributed_trace def list_usages( @@ -198,10 +200,10 @@ def list_usages( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PartitionUsagesResult] + ) + cls: ClsType[_models.PartitionUsagesResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -227,7 +229,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -243,7 +245,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -251,13 +253,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("PartitionUsagesResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -270,4 +272,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_usages.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/usages"} # type: ignore + list_usages.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/usages" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_partition_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_partition_region_operations.py index 6d4cbbab300c..73c287290209 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_partition_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_partition_region_operations.py @@ -94,10 +94,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PartitionMetricListResult] + ) + cls: ClsType[_models.PartitionMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -124,7 +124,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -140,7 +140,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -148,13 +148,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("PartitionMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -167,4 +167,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_region_operations.py index bf46f4e3f032..93c23d73a1b6 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_region_operations.py @@ -94,10 +94,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + ) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -124,7 +124,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -140,7 +140,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -148,13 +148,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("MetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -167,4 +167,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/metrics" + } 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 index 3954f90316b1..5692a52ca1cd 100644 --- 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 @@ -166,11 +166,11 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataTransferJobGetResults] + ) + 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 @@ -194,9 +194,9 @@ async def create( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -213,7 +213,9 @@ async def create( return deserialized - create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}"} # type: ignore + create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}" + } @distributed_trace_async async def get( @@ -244,10 +246,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataTransferJobGetResults] + ) + cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -260,9 +262,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -279,7 +281,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}" + } @distributed_trace_async async def pause( @@ -310,10 +314,10 @@ async def pause( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataTransferJobGetResults] + ) + cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) request = build_pause_request( resource_group_name=resource_group_name, @@ -326,9 +330,9 @@ async def pause( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -345,7 +349,9 @@ async def pause( return deserialized - pause.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/pause"} # type: ignore + pause.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/pause" + } @distributed_trace_async async def resume( @@ -376,10 +382,10 @@ async def resume( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataTransferJobGetResults] + ) + cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) request = build_resume_request( resource_group_name=resource_group_name, @@ -392,9 +398,9 @@ async def resume( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -411,7 +417,9 @@ async def resume( return deserialized - resume.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/resume"} # type: ignore + resume.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/resume" + } @distributed_trace_async async def cancel( @@ -442,10 +450,10 @@ async def cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataTransferJobGetResults] + ) + cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) request = build_cancel_request( resource_group_name=resource_group_name, @@ -458,9 +466,9 @@ async def cancel( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -477,7 +485,9 @@ async def cancel( return deserialized - cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/cancel"} # type: ignore + cancel.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/cancel" + } @distributed_trace def list_by_database_account( @@ -500,10 +510,10 @@ def list_by_database_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataTransferJobFeedResults] + ) + cls: ClsType[_models.DataTransferJobFeedResults] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -526,7 +536,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -542,7 +552,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -550,13 +560,13 @@ 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) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -569,4 +579,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database_account.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs"} # type: ignore + list_by_database_account.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_account_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_account_region_operations.py index 5c8d85b1b799..bcd5f2e152dc 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_account_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_account_region_operations.py @@ -82,10 +82,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + ) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -110,7 +110,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -126,7 +126,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -134,13 +134,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("MetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -153,4 +153,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/metrics" + } 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 db108e5f4d06..24c73d43c728 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 @@ -106,10 +106,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountGetResults] + ) + cls: ClsType[_models.DatabaseAccountGetResults] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -121,9 +121,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -140,7 +140,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } async def _update_initial( self, @@ -160,11 +162,11 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountGetResults] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseAccountGetResults] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -187,9 +189,9 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -206,7 +208,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } @overload async def begin_update( @@ -320,16 +324,16 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseAccountGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + raw_result = await self._update_initial( resource_group_name=resource_group_name, account_name=account_name, update_parameters=update_parameters, @@ -349,7 +353,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -361,9 +365,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } async def _create_or_update_initial( self, @@ -383,11 +389,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountGetResults] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseAccountGetResults] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -410,9 +416,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -429,7 +435,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } @overload async def begin_create_or_update( @@ -550,16 +558,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseAccountGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, account_name=account_name, create_update_parameters=create_update_parameters, @@ -579,7 +587,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -591,9 +599,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, **kwargs: Any @@ -609,10 +619,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -624,9 +634,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -639,7 +649,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } @distributed_trace_async async def begin_delete(self, resource_group_name: str, account_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -665,13 +677,13 @@ async def begin_delete(self, resource_group_name: str, account_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -689,7 +701,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -701,9 +713,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } async def _failover_priority_change_initial( # pylint: disable=inconsistent-return-statements self, @@ -723,11 +737,11 @@ async def _failover_priority_change_initial( # pylint: disable=inconsistent-ret _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -750,9 +764,9 @@ async def _failover_priority_change_initial( # pylint: disable=inconsistent-ret params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -765,7 +779,9 @@ async def _failover_priority_change_initial( # pylint: disable=inconsistent-ret if cls: return cls(pipeline_response, None, {}) - _failover_priority_change_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange"} # type: ignore + _failover_priority_change_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange" + } @overload async def begin_failover_priority_change( @@ -882,14 +898,14 @@ async def begin_failover_priority_change( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._failover_priority_change_initial( # type: ignore resource_group_name=resource_group_name, @@ -909,7 +925,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -921,9 +937,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_failover_priority_change.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange"} # type: ignore + begin_failover_priority_change.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange" + } @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.DatabaseAccountGetResults"]: @@ -939,10 +957,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DatabaseAccountGetResult _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountsListResult] + ) + cls: ClsType[_models.DatabaseAccountsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -963,7 +981,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -979,7 +997,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -987,13 +1005,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseAccountsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1006,7 +1024,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts"} @distributed_trace def list_by_resource_group( @@ -1027,10 +1045,10 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountsListResult] + ) + cls: ClsType[_models.DatabaseAccountsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1052,7 +1070,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -1068,7 +1086,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1076,13 +1094,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseAccountsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1095,7 +1113,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts" + } @distributed_trace_async async def list_keys( @@ -1124,10 +1144,10 @@ async def list_keys( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountListKeysResult] + ) + cls: ClsType[_models.DatabaseAccountListKeysResult] = kwargs.pop("cls", None) request = build_list_keys_request( resource_group_name=resource_group_name, @@ -1139,9 +1159,9 @@ async def list_keys( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1158,7 +1178,9 @@ async def list_keys( return deserialized - list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys"} # type: ignore + list_keys.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys" + } @distributed_trace_async async def list_connection_strings( @@ -1187,10 +1209,10 @@ async def list_connection_strings( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountListConnectionStringsResult] + ) + cls: ClsType[_models.DatabaseAccountListConnectionStringsResult] = kwargs.pop("cls", None) request = build_list_connection_strings_request( resource_group_name=resource_group_name, @@ -1202,9 +1224,9 @@ async def list_connection_strings( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1221,7 +1243,9 @@ async def list_connection_strings( return deserialized - list_connection_strings.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings"} # type: ignore + list_connection_strings.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings" + } async def _offline_region_initial( # pylint: disable=inconsistent-return-statements self, @@ -1241,11 +1265,11 @@ async def _offline_region_initial( # pylint: disable=inconsistent-return-statem _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1268,9 +1292,9 @@ async def _offline_region_initial( # pylint: disable=inconsistent-return-statem params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1284,7 +1308,9 @@ async def _offline_region_initial( # pylint: disable=inconsistent-return-statem if cls: return cls(pipeline_response, None, {}) - _offline_region_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion"} # type: ignore + _offline_region_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion" + } @overload async def begin_offline_region( @@ -1394,14 +1420,14 @@ async def begin_offline_region( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._offline_region_initial( # type: ignore resource_group_name=resource_group_name, @@ -1421,7 +1447,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1433,9 +1459,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_offline_region.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion"} # type: ignore + begin_offline_region.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion" + } async def _online_region_initial( # pylint: disable=inconsistent-return-statements self, @@ -1455,11 +1483,11 @@ async def _online_region_initial( # pylint: disable=inconsistent-return-stateme _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1482,9 +1510,9 @@ async def _online_region_initial( # pylint: disable=inconsistent-return-stateme params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1498,7 +1526,9 @@ async def _online_region_initial( # pylint: disable=inconsistent-return-stateme if cls: return cls(pipeline_response, None, {}) - _online_region_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion"} # type: ignore + _online_region_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion" + } @overload async def begin_online_region( @@ -1608,14 +1638,14 @@ async def begin_online_region( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._online_region_initial( # type: ignore resource_group_name=resource_group_name, @@ -1635,7 +1665,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1647,9 +1677,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_online_region.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion"} # type: ignore + begin_online_region.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion" + } @distributed_trace_async async def get_read_only_keys( @@ -1678,10 +1710,10 @@ async def get_read_only_keys( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountListReadOnlyKeysResult] + ) + cls: ClsType[_models.DatabaseAccountListReadOnlyKeysResult] = kwargs.pop("cls", None) request = build_get_read_only_keys_request( resource_group_name=resource_group_name, @@ -1693,9 +1725,9 @@ async def get_read_only_keys( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1712,7 +1744,9 @@ async def get_read_only_keys( return deserialized - get_read_only_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys"} # type: ignore + get_read_only_keys.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys" + } @distributed_trace_async async def list_read_only_keys( @@ -1741,10 +1775,10 @@ async def list_read_only_keys( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountListReadOnlyKeysResult] + ) + cls: ClsType[_models.DatabaseAccountListReadOnlyKeysResult] = kwargs.pop("cls", None) request = build_list_read_only_keys_request( resource_group_name=resource_group_name, @@ -1756,9 +1790,9 @@ async def list_read_only_keys( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1775,7 +1809,9 @@ async def list_read_only_keys( return deserialized - list_read_only_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys"} # type: ignore + list_read_only_keys.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys" + } async def _regenerate_key_initial( # pylint: disable=inconsistent-return-statements self, @@ -1795,11 +1831,11 @@ async def _regenerate_key_initial( # pylint: disable=inconsistent-return-statem _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1822,9 +1858,9 @@ async def _regenerate_key_initial( # pylint: disable=inconsistent-return-statem params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1837,7 +1873,9 @@ async def _regenerate_key_initial( # pylint: disable=inconsistent-return-statem if cls: return cls(pipeline_response, None, {}) - _regenerate_key_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey"} # type: ignore + _regenerate_key_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey" + } @overload async def begin_regenerate_key( @@ -1946,14 +1984,14 @@ async def begin_regenerate_key( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._regenerate_key_initial( # type: ignore resource_group_name=resource_group_name, @@ -1973,7 +2011,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1985,9 +2023,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_regenerate_key.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey"} # type: ignore + begin_regenerate_key.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey" + } @distributed_trace_async async def check_name_exists(self, account_name: str, **kwargs: Any) -> bool: @@ -2013,10 +2053,10 @@ async def check_name_exists(self, account_name: str, **kwargs: Any) -> bool: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_check_name_exists_request( account_name=account_name, @@ -2026,9 +2066,9 @@ async def check_name_exists(self, account_name: str, **kwargs: Any) -> bool: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2042,7 +2082,7 @@ async def check_name_exists(self, account_name: str, **kwargs: Any) -> bool: return cls(pipeline_response, None, {}) return 200 <= response.status_code <= 299 - check_name_exists.metadata = {"url": "/providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}"} # type: ignore + check_name_exists.metadata = {"url": "/providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}"} @distributed_trace def list_metrics( @@ -2067,10 +2107,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + ) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2094,7 +2134,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -2110,7 +2150,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2118,13 +2158,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("MetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2137,7 +2177,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics" + } @distributed_trace def list_usages( @@ -2162,10 +2204,10 @@ def list_usages( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.UsagesResult] + ) + cls: ClsType[_models.UsagesResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2189,7 +2231,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -2205,7 +2247,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2213,13 +2255,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("UsagesResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2232,7 +2274,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_usages.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages"} # type: ignore + list_usages.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages" + } @distributed_trace def list_metric_definitions( @@ -2253,10 +2297,10 @@ def list_metric_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricDefinitionsListResult] + ) + cls: ClsType[_models.MetricDefinitionsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2279,7 +2323,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -2295,7 +2339,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2303,13 +2347,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("MetricDefinitionsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2322,4 +2366,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metric_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions"} # type: ignore + list_metric_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_operations.py index 6cf8af613227..705c2009641f 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_operations.py @@ -87,10 +87,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + ) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -115,7 +115,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -131,7 +131,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -139,13 +139,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("MetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -158,7 +158,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metrics" + } @distributed_trace def list_usages( @@ -190,10 +192,10 @@ def list_usages( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.UsagesResult] + ) + cls: ClsType[_models.UsagesResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -218,7 +220,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -234,7 +236,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -242,13 +244,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("UsagesResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -261,7 +263,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_usages.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/usages"} # type: ignore + list_usages.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/usages" + } @distributed_trace def list_metric_definitions( @@ -284,10 +288,10 @@ def list_metric_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricDefinitionsListResult] + ) + cls: ClsType[_models.MetricDefinitionsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -311,7 +315,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -327,7 +331,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -335,13 +339,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("MetricDefinitionsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -354,4 +358,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metric_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metricDefinitions"} # type: ignore + list_metric_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metricDefinitions" + } 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 index 6afe7dddb442..57ba31fe80bd 100644 --- 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 @@ -86,10 +86,10 @@ def list_graphs( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GraphResourcesListResult] + ) + cls: ClsType[_models.GraphResourcesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -112,7 +112,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -128,7 +128,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -136,13 +136,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -155,7 +155,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_graphs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs"} # type: ignore + list_graphs.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs" + } @distributed_trace_async async def get_graph( @@ -187,10 +189,10 @@ async def get_graph( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GraphResourceGetResults] + ) + cls: ClsType[_models.GraphResourceGetResults] = kwargs.pop("cls", None) request = build_get_graph_request( resource_group_name=resource_group_name, @@ -203,9 +205,9 @@ async def get_graph( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -222,7 +224,9 @@ async def get_graph( return deserialized - get_graph.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}"} # type: ignore + get_graph.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}" + } async def _create_update_graph_initial( self, @@ -243,11 +247,11 @@ async def _create_update_graph_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.GraphResourceGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.GraphResourceGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -271,9 +275,9 @@ async def _create_update_graph_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -292,7 +296,9 @@ async def _create_update_graph_initial( return deserialized - _create_update_graph_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}"} # type: ignore + _create_update_graph_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}" + } @overload async def begin_create_update_graph( @@ -416,16 +422,16 @@ async def begin_create_update_graph( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GraphResourceGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_graph_initial( # type: ignore + raw_result = await self._create_update_graph_initial( resource_group_name=resource_group_name, account_name=account_name, graph_name=graph_name, @@ -446,7 +452,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -458,9 +464,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_graph.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}"} # type: ignore + begin_create_update_graph.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}" + } async def _delete_graph_resource_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, graph_name: str, **kwargs: Any @@ -476,10 +484,10 @@ async def _delete_graph_resource_initial( # pylint: disable=inconsistent-return _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_graph_resource_request( resource_group_name=resource_group_name, @@ -492,9 +500,9 @@ async def _delete_graph_resource_initial( # pylint: disable=inconsistent-return params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -507,7 +515,9 @@ async def _delete_graph_resource_initial( # pylint: disable=inconsistent-return if cls: return cls(pipeline_response, None, {}) - _delete_graph_resource_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}"} # type: ignore + _delete_graph_resource_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}" + } @distributed_trace_async async def begin_delete_graph_resource( @@ -537,13 +547,13 @@ async def begin_delete_graph_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_graph_resource_initial( # type: ignore resource_group_name=resource_group_name, @@ -562,7 +572,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -574,6 +584,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_graph_resource.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}"} # type: ignore + begin_delete_graph_resource.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_gremlin_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_gremlin_resources_operations.py index e47a0615bd74..b2160bc16258 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_gremlin_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_gremlin_resources_operations.py @@ -99,10 +99,10 @@ def list_gremlin_databases( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GremlinDatabaseListResult] + ) + cls: ClsType[_models.GremlinDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -125,7 +125,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -141,7 +141,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -149,13 +149,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("GremlinDatabaseListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -168,7 +168,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_gremlin_databases.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases"} # type: ignore + list_gremlin_databases.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases" + } @distributed_trace_async async def get_gremlin_database( @@ -200,10 +202,10 @@ async def get_gremlin_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GremlinDatabaseGetResults] + ) + cls: ClsType[_models.GremlinDatabaseGetResults] = kwargs.pop("cls", None) request = build_get_gremlin_database_request( resource_group_name=resource_group_name, @@ -216,9 +218,9 @@ async def get_gremlin_database( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -235,7 +237,9 @@ async def get_gremlin_database( return deserialized - get_gremlin_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}"} # type: ignore + get_gremlin_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}" + } async def _create_update_gremlin_database_initial( self, @@ -256,11 +260,11 @@ async def _create_update_gremlin_database_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.GremlinDatabaseGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.GremlinDatabaseGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -286,9 +290,9 @@ async def _create_update_gremlin_database_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -307,7 +311,9 @@ async def _create_update_gremlin_database_initial( return deserialized - _create_update_gremlin_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}"} # type: ignore + _create_update_gremlin_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}" + } @overload async def begin_create_update_gremlin_database( @@ -434,16 +440,16 @@ async def begin_create_update_gremlin_database( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GremlinDatabaseGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GremlinDatabaseGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_gremlin_database_initial( # type: ignore + raw_result = await self._create_update_gremlin_database_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -464,7 +470,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -476,9 +482,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_gremlin_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}"} # type: ignore + begin_create_update_gremlin_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}" + } async def _delete_gremlin_database_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -494,10 +502,10 @@ async def _delete_gremlin_database_initial( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_gremlin_database_request( resource_group_name=resource_group_name, @@ -510,9 +518,9 @@ async def _delete_gremlin_database_initial( # pylint: disable=inconsistent-retu params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -525,7 +533,9 @@ async def _delete_gremlin_database_initial( # pylint: disable=inconsistent-retu if cls: return cls(pipeline_response, None, {}) - _delete_gremlin_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}"} # type: ignore + _delete_gremlin_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}" + } @distributed_trace_async async def begin_delete_gremlin_database( @@ -555,13 +565,13 @@ async def begin_delete_gremlin_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_gremlin_database_initial( # type: ignore resource_group_name=resource_group_name, @@ -580,7 +590,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -592,9 +602,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_gremlin_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}"} # type: ignore + begin_delete_gremlin_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}" + } @distributed_trace_async async def get_gremlin_database_throughput( @@ -626,10 +638,10 @@ async def get_gremlin_database_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_gremlin_database_throughput_request( resource_group_name=resource_group_name, @@ -642,9 +654,9 @@ async def get_gremlin_database_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -661,7 +673,9 @@ async def get_gremlin_database_throughput( return deserialized - get_gremlin_database_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default"} # type: ignore + get_gremlin_database_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default" + } async def _update_gremlin_database_throughput_initial( self, @@ -682,11 +696,11 @@ async def _update_gremlin_database_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -710,9 +724,9 @@ async def _update_gremlin_database_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -731,7 +745,9 @@ async def _update_gremlin_database_throughput_initial( return deserialized - _update_gremlin_database_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default"} # type: ignore + _update_gremlin_database_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default" + } @overload async def begin_update_gremlin_database_throughput( @@ -858,16 +874,16 @@ async def begin_update_gremlin_database_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_gremlin_database_throughput_initial( # type: ignore + raw_result = await self._update_gremlin_database_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -888,7 +904,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -900,9 +916,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_gremlin_database_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default"} # type: ignore + begin_update_gremlin_database_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default" + } async def _migrate_gremlin_database_to_autoscale_initial( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -918,10 +936,10 @@ async def _migrate_gremlin_database_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_gremlin_database_to_autoscale_request( resource_group_name=resource_group_name, @@ -934,9 +952,9 @@ async def _migrate_gremlin_database_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -955,7 +973,9 @@ async def _migrate_gremlin_database_to_autoscale_initial( return deserialized - _migrate_gremlin_database_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_gremlin_database_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace_async async def begin_migrate_gremlin_database_to_autoscale( @@ -987,15 +1007,15 @@ async def begin_migrate_gremlin_database_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_gremlin_database_to_autoscale_initial( # type: ignore + raw_result = await self._migrate_gremlin_database_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1014,7 +1034,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1026,9 +1046,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_gremlin_database_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_gremlin_database_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale" + } async def _migrate_gremlin_database_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -1044,10 +1066,10 @@ async def _migrate_gremlin_database_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_gremlin_database_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -1060,9 +1082,9 @@ async def _migrate_gremlin_database_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1081,7 +1103,9 @@ async def _migrate_gremlin_database_to_manual_throughput_initial( return deserialized - _migrate_gremlin_database_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_gremlin_database_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace_async async def begin_migrate_gremlin_database_to_manual_throughput( @@ -1113,15 +1137,15 @@ async def begin_migrate_gremlin_database_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_gremlin_database_to_manual_throughput_initial( # type: ignore + raw_result = await self._migrate_gremlin_database_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1140,7 +1164,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1152,9 +1176,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_gremlin_database_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_gremlin_database_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def list_gremlin_graphs( @@ -1179,10 +1205,10 @@ def list_gremlin_graphs( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GremlinGraphListResult] + ) + cls: ClsType[_models.GremlinGraphListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1206,7 +1232,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -1222,7 +1248,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1230,13 +1256,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("GremlinGraphListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1249,7 +1275,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_gremlin_graphs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs"} # type: ignore + list_gremlin_graphs.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs" + } @distributed_trace_async async def get_gremlin_graph( @@ -1282,10 +1310,10 @@ async def get_gremlin_graph( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GremlinGraphGetResults] + ) + cls: ClsType[_models.GremlinGraphGetResults] = kwargs.pop("cls", None) request = build_get_gremlin_graph_request( resource_group_name=resource_group_name, @@ -1299,9 +1327,9 @@ async def get_gremlin_graph( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1318,7 +1346,9 @@ async def get_gremlin_graph( return deserialized - get_gremlin_graph.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}"} # type: ignore + get_gremlin_graph.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}" + } async def _create_update_gremlin_graph_initial( self, @@ -1340,11 +1370,11 @@ async def _create_update_gremlin_graph_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.GremlinGraphGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.GremlinGraphGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1369,9 +1399,9 @@ async def _create_update_gremlin_graph_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1390,7 +1420,9 @@ async def _create_update_gremlin_graph_initial( return deserialized - _create_update_gremlin_graph_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}"} # type: ignore + _create_update_gremlin_graph_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}" + } @overload async def begin_create_update_gremlin_graph( @@ -1523,16 +1555,16 @@ async def begin_create_update_gremlin_graph( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GremlinGraphGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GremlinGraphGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_gremlin_graph_initial( # type: ignore + raw_result = await self._create_update_gremlin_graph_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1554,7 +1586,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1566,9 +1598,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_gremlin_graph.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}"} # type: ignore + begin_create_update_gremlin_graph.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}" + } async def _delete_gremlin_graph_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, database_name: str, graph_name: str, **kwargs: Any @@ -1584,10 +1618,10 @@ async def _delete_gremlin_graph_initial( # pylint: disable=inconsistent-return- _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_gremlin_graph_request( resource_group_name=resource_group_name, @@ -1601,9 +1635,9 @@ async def _delete_gremlin_graph_initial( # pylint: disable=inconsistent-return- params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1616,7 +1650,9 @@ async def _delete_gremlin_graph_initial( # pylint: disable=inconsistent-return- if cls: return cls(pipeline_response, None, {}) - _delete_gremlin_graph_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}"} # type: ignore + _delete_gremlin_graph_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}" + } @distributed_trace_async async def begin_delete_gremlin_graph( @@ -1648,13 +1684,13 @@ async def begin_delete_gremlin_graph( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_gremlin_graph_initial( # type: ignore resource_group_name=resource_group_name, @@ -1674,7 +1710,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1686,9 +1722,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_gremlin_graph.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}"} # type: ignore + begin_delete_gremlin_graph.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}" + } @distributed_trace_async async def get_gremlin_graph_throughput( @@ -1722,10 +1760,10 @@ async def get_gremlin_graph_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_gremlin_graph_throughput_request( resource_group_name=resource_group_name, @@ -1739,9 +1777,9 @@ async def get_gremlin_graph_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1758,7 +1796,9 @@ async def get_gremlin_graph_throughput( return deserialized - get_gremlin_graph_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default"} # type: ignore + get_gremlin_graph_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default" + } async def _update_gremlin_graph_throughput_initial( self, @@ -1780,11 +1820,11 @@ async def _update_gremlin_graph_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1809,9 +1849,9 @@ async def _update_gremlin_graph_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1830,7 +1870,9 @@ async def _update_gremlin_graph_throughput_initial( return deserialized - _update_gremlin_graph_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default"} # type: ignore + _update_gremlin_graph_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default" + } @overload async def begin_update_gremlin_graph_throughput( @@ -1966,16 +2008,16 @@ async def begin_update_gremlin_graph_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_gremlin_graph_throughput_initial( # type: ignore + raw_result = await self._update_gremlin_graph_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1997,7 +2039,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2009,9 +2051,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_gremlin_graph_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default"} # type: ignore + begin_update_gremlin_graph_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default" + } async def _migrate_gremlin_graph_to_autoscale_initial( self, resource_group_name: str, account_name: str, database_name: str, graph_name: str, **kwargs: Any @@ -2027,10 +2071,10 @@ async def _migrate_gremlin_graph_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_gremlin_graph_to_autoscale_request( resource_group_name=resource_group_name, @@ -2044,9 +2088,9 @@ async def _migrate_gremlin_graph_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2065,7 +2109,9 @@ async def _migrate_gremlin_graph_to_autoscale_initial( return deserialized - _migrate_gremlin_graph_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_gremlin_graph_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace_async async def begin_migrate_gremlin_graph_to_autoscale( @@ -2099,15 +2145,15 @@ async def begin_migrate_gremlin_graph_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_gremlin_graph_to_autoscale_initial( # type: ignore + raw_result = await self._migrate_gremlin_graph_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2127,7 +2173,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2139,9 +2185,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_gremlin_graph_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_gremlin_graph_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToAutoscale" + } async def _migrate_gremlin_graph_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, graph_name: str, **kwargs: Any @@ -2157,10 +2205,10 @@ async def _migrate_gremlin_graph_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_gremlin_graph_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -2174,9 +2222,9 @@ async def _migrate_gremlin_graph_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2195,7 +2243,9 @@ async def _migrate_gremlin_graph_to_manual_throughput_initial( return deserialized - _migrate_gremlin_graph_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_gremlin_graph_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace_async async def begin_migrate_gremlin_graph_to_manual_throughput( @@ -2229,15 +2279,15 @@ async def begin_migrate_gremlin_graph_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_gremlin_graph_to_manual_throughput_initial( # type: ignore + raw_result = await self._migrate_gremlin_graph_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2257,7 +2307,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2269,9 +2319,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_gremlin_graph_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_gremlin_graph_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToManualThroughput" + } async def _retrieve_continuous_backup_information_initial( self, @@ -2293,11 +2345,11 @@ async def _retrieve_continuous_backup_information_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.BackupInformation]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BackupInformation]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2322,9 +2374,9 @@ async def _retrieve_continuous_backup_information_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2343,7 +2395,9 @@ async def _retrieve_continuous_backup_information_initial( return deserialized - _retrieve_continuous_backup_information_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/retrieveContinuousBackupInformation"} # type: ignore + _retrieve_continuous_backup_information_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/retrieveContinuousBackupInformation" + } @overload async def begin_retrieve_continuous_backup_information( @@ -2472,16 +2526,16 @@ async def begin_retrieve_continuous_backup_information( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupInformation] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackupInformation] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._retrieve_continuous_backup_information_initial( # type: ignore + raw_result = await self._retrieve_continuous_backup_information_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2503,9 +2557,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2517,6 +2571,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_retrieve_continuous_backup_information.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/retrieveContinuousBackupInformation"} # type: ignore + begin_retrieve_continuous_backup_information.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/retrieveContinuousBackupInformation" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_locations_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_locations_operations.py index 1eb27cfb8949..c872f9b3d493 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_locations_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_locations_operations.py @@ -70,10 +70,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.LocationGetResult"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LocationListResult] + ) + cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -94,7 +94,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -110,7 +110,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -118,13 +118,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("LocationListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -137,7 +137,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations"} @distributed_trace_async async def get(self, location: str, **kwargs: Any) -> _models.LocationGetResult: @@ -162,10 +162,10 @@ async def get(self, location: str, **kwargs: Any) -> _models.LocationGetResult: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LocationGetResult] + ) + cls: ClsType[_models.LocationGetResult] = kwargs.pop("cls", None) request = build_get_request( location=location, @@ -176,9 +176,9 @@ async def get(self, location: str, **kwargs: Any) -> _models.LocationGetResult: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -195,4 +195,4 @@ async def get(self, location: str, **kwargs: Any) -> _models.LocationGetResult: return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}"} 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 0c09b8e5333d..ac8a1c64b40d 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 @@ -112,10 +112,10 @@ def list_mongo_db_databases( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoDBDatabaseListResult] + ) + cls: ClsType[_models.MongoDBDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -138,7 +138,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -154,7 +154,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -162,13 +162,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("MongoDBDatabaseListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -181,7 +181,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_mongo_db_databases.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases"} # type: ignore + list_mongo_db_databases.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases" + } @distributed_trace_async async def get_mongo_db_database( @@ -213,10 +215,10 @@ async def get_mongo_db_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoDBDatabaseGetResults] + ) + cls: ClsType[_models.MongoDBDatabaseGetResults] = kwargs.pop("cls", None) request = build_get_mongo_db_database_request( resource_group_name=resource_group_name, @@ -229,9 +231,9 @@ async def get_mongo_db_database( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -248,7 +250,9 @@ async def get_mongo_db_database( return deserialized - get_mongo_db_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}"} # type: ignore + get_mongo_db_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}" + } async def _create_update_mongo_db_database_initial( self, @@ -269,11 +273,11 @@ async def _create_update_mongo_db_database_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.MongoDBDatabaseGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.MongoDBDatabaseGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -299,9 +303,9 @@ async def _create_update_mongo_db_database_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -320,7 +324,9 @@ async def _create_update_mongo_db_database_initial( return deserialized - _create_update_mongo_db_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}"} # type: ignore + _create_update_mongo_db_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}" + } @overload async def begin_create_update_mongo_db_database( @@ -447,16 +453,16 @@ async def begin_create_update_mongo_db_database( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoDBDatabaseGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MongoDBDatabaseGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_mongo_db_database_initial( # type: ignore + raw_result = await self._create_update_mongo_db_database_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -477,7 +483,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -489,9 +495,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_mongo_db_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}"} # type: ignore + begin_create_update_mongo_db_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}" + } async def _delete_mongo_db_database_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -507,10 +515,10 @@ async def _delete_mongo_db_database_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_mongo_db_database_request( resource_group_name=resource_group_name, @@ -523,9 +531,9 @@ async def _delete_mongo_db_database_initial( # pylint: disable=inconsistent-ret params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -538,7 +546,9 @@ async def _delete_mongo_db_database_initial( # pylint: disable=inconsistent-ret if cls: return cls(pipeline_response, None, {}) - _delete_mongo_db_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}"} # type: ignore + _delete_mongo_db_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}" + } @distributed_trace_async async def begin_delete_mongo_db_database( @@ -568,13 +578,13 @@ async def begin_delete_mongo_db_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_mongo_db_database_initial( # type: ignore resource_group_name=resource_group_name, @@ -593,7 +603,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -605,9 +615,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_mongo_db_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}"} # type: ignore + begin_delete_mongo_db_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}" + } @distributed_trace_async async def get_mongo_db_database_throughput( @@ -639,10 +651,10 @@ async def get_mongo_db_database_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_mongo_db_database_throughput_request( resource_group_name=resource_group_name, @@ -655,9 +667,9 @@ async def get_mongo_db_database_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -674,7 +686,9 @@ async def get_mongo_db_database_throughput( return deserialized - get_mongo_db_database_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default"} # type: ignore + get_mongo_db_database_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default" + } async def _update_mongo_db_database_throughput_initial( self, @@ -695,11 +709,11 @@ async def _update_mongo_db_database_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -723,9 +737,9 @@ async def _update_mongo_db_database_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -744,7 +758,9 @@ async def _update_mongo_db_database_throughput_initial( return deserialized - _update_mongo_db_database_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default"} # type: ignore + _update_mongo_db_database_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default" + } @overload async def begin_update_mongo_db_database_throughput( @@ -871,16 +887,16 @@ async def begin_update_mongo_db_database_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_mongo_db_database_throughput_initial( # type: ignore + raw_result = await self._update_mongo_db_database_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -901,7 +917,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -913,9 +929,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_mongo_db_database_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default"} # type: ignore + begin_update_mongo_db_database_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default" + } async def _migrate_mongo_db_database_to_autoscale_initial( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -931,10 +949,10 @@ async def _migrate_mongo_db_database_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_mongo_db_database_to_autoscale_request( resource_group_name=resource_group_name, @@ -947,9 +965,9 @@ async def _migrate_mongo_db_database_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -968,7 +986,9 @@ async def _migrate_mongo_db_database_to_autoscale_initial( return deserialized - _migrate_mongo_db_database_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_mongo_db_database_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace_async async def begin_migrate_mongo_db_database_to_autoscale( @@ -1000,15 +1020,15 @@ async def begin_migrate_mongo_db_database_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_mongo_db_database_to_autoscale_initial( # type: ignore + raw_result = await self._migrate_mongo_db_database_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1027,7 +1047,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1039,9 +1059,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_mongo_db_database_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_mongo_db_database_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale" + } async def _migrate_mongo_db_database_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -1057,10 +1079,10 @@ async def _migrate_mongo_db_database_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_mongo_db_database_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -1073,9 +1095,9 @@ async def _migrate_mongo_db_database_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1094,7 +1116,9 @@ async def _migrate_mongo_db_database_to_manual_throughput_initial( return deserialized - _migrate_mongo_db_database_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_mongo_db_database_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace_async async def begin_migrate_mongo_db_database_to_manual_throughput( @@ -1126,15 +1150,15 @@ async def begin_migrate_mongo_db_database_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_mongo_db_database_to_manual_throughput_initial( # type: ignore + raw_result = await self._migrate_mongo_db_database_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1153,7 +1177,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1165,9 +1189,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_mongo_db_database_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_mongo_db_database_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput" + } async def _mongo_db_database_retrieve_throughput_distribution_initial( self, @@ -1188,11 +1214,11 @@ async def _mongo_db_database_retrieve_throughput_distribution_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1216,9 +1242,9 @@ async def _mongo_db_database_retrieve_throughput_distribution_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1237,7 +1263,9 @@ async def _mongo_db_database_retrieve_throughput_distribution_initial( return deserialized - _mongo_db_database_retrieve_throughput_distribution_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + _mongo_db_database_retrieve_throughput_distribution_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution" + } @overload async def begin_mongo_db_database_retrieve_throughput_distribution( @@ -1363,16 +1391,16 @@ async def begin_mongo_db_database_retrieve_throughput_distribution( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + 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( # type: ignore + 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, @@ -1393,9 +1421,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1407,9 +1435,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_mongo_db_database_retrieve_throughput_distribution.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + begin_mongo_db_database_retrieve_throughput_distribution.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution" + } async def _mongo_db_database_redistribute_throughput_initial( self, @@ -1430,11 +1460,11 @@ async def _mongo_db_database_redistribute_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1458,9 +1488,9 @@ async def _mongo_db_database_redistribute_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1479,7 +1509,9 @@ async def _mongo_db_database_redistribute_throughput_initial( return deserialized - _mongo_db_database_redistribute_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/redistributeThroughput"} # type: ignore + _mongo_db_database_redistribute_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/redistributeThroughput" + } @overload async def begin_mongo_db_database_redistribute_throughput( @@ -1606,16 +1638,16 @@ async def begin_mongo_db_database_redistribute_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._mongo_db_database_redistribute_throughput_initial( # type: ignore + raw_result = await self._mongo_db_database_redistribute_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1636,9 +1668,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1650,9 +1682,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_mongo_db_database_redistribute_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/redistributeThroughput"} # type: ignore + begin_mongo_db_database_redistribute_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/redistributeThroughput" + } async def _mongo_db_container_retrieve_throughput_distribution_initial( self, @@ -1674,11 +1708,11 @@ async def _mongo_db_container_retrieve_throughput_distribution_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1703,9 +1737,9 @@ async def _mongo_db_container_retrieve_throughput_distribution_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1724,7 +1758,9 @@ async def _mongo_db_container_retrieve_throughput_distribution_initial( return deserialized - _mongo_db_container_retrieve_throughput_distribution_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + _mongo_db_container_retrieve_throughput_distribution_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution" + } @overload async def begin_mongo_db_container_retrieve_throughput_distribution( @@ -1859,16 +1895,16 @@ async def begin_mongo_db_container_retrieve_throughput_distribution( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + 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( # type: ignore + 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, @@ -1890,9 +1926,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1904,9 +1940,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_mongo_db_container_retrieve_throughput_distribution.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + begin_mongo_db_container_retrieve_throughput_distribution.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution" + } async def _mongo_db_container_redistribute_throughput_initial( self, @@ -1928,11 +1966,11 @@ async def _mongo_db_container_redistribute_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1957,9 +1995,9 @@ async def _mongo_db_container_redistribute_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1978,7 +2016,9 @@ async def _mongo_db_container_redistribute_throughput_initial( return deserialized - _mongo_db_container_redistribute_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput"} # type: ignore + _mongo_db_container_redistribute_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput" + } @overload async def begin_mongo_db_container_redistribute_throughput( @@ -2114,16 +2154,16 @@ async def begin_mongo_db_container_redistribute_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._mongo_db_container_redistribute_throughput_initial( # type: ignore + raw_result = await self._mongo_db_container_redistribute_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2145,9 +2185,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2159,9 +2199,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_mongo_db_container_redistribute_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput"} # type: ignore + begin_mongo_db_container_redistribute_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput" + } @distributed_trace def list_mongo_db_collections( @@ -2186,10 +2228,10 @@ def list_mongo_db_collections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoDBCollectionListResult] + ) + cls: ClsType[_models.MongoDBCollectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2213,7 +2255,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -2229,7 +2271,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2237,13 +2279,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2256,7 +2298,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_mongo_db_collections.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections"} # type: ignore + list_mongo_db_collections.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections" + } @distributed_trace_async async def get_mongo_db_collection( @@ -2289,10 +2333,10 @@ async def get_mongo_db_collection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoDBCollectionGetResults] + ) + cls: ClsType[_models.MongoDBCollectionGetResults] = kwargs.pop("cls", None) request = build_get_mongo_db_collection_request( resource_group_name=resource_group_name, @@ -2306,9 +2350,9 @@ async def get_mongo_db_collection( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2325,7 +2369,9 @@ async def get_mongo_db_collection( return deserialized - get_mongo_db_collection.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}"} # type: ignore + get_mongo_db_collection.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}" + } async def _create_update_mongo_db_collection_initial( self, @@ -2347,11 +2393,11 @@ async def _create_update_mongo_db_collection_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.MongoDBCollectionGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.MongoDBCollectionGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2378,9 +2424,9 @@ async def _create_update_mongo_db_collection_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2399,7 +2445,9 @@ async def _create_update_mongo_db_collection_initial( return deserialized - _create_update_mongo_db_collection_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}"} # type: ignore + _create_update_mongo_db_collection_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}" + } @overload async def begin_create_update_mongo_db_collection( @@ -2535,16 +2583,16 @@ async def begin_create_update_mongo_db_collection( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoDBCollectionGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_mongo_db_collection_initial( # type: ignore + raw_result = await self._create_update_mongo_db_collection_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2566,7 +2614,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2578,9 +2626,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_mongo_db_collection.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}"} # type: ignore + begin_create_update_mongo_db_collection.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}" + } async def _delete_mongo_db_collection_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any @@ -2596,10 +2646,10 @@ async def _delete_mongo_db_collection_initial( # pylint: disable=inconsistent-r _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_mongo_db_collection_request( resource_group_name=resource_group_name, @@ -2613,9 +2663,9 @@ async def _delete_mongo_db_collection_initial( # pylint: disable=inconsistent-r params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2628,7 +2678,9 @@ async def _delete_mongo_db_collection_initial( # pylint: disable=inconsistent-r if cls: return cls(pipeline_response, None, {}) - _delete_mongo_db_collection_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}"} # type: ignore + _delete_mongo_db_collection_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}" + } @distributed_trace_async async def begin_delete_mongo_db_collection( @@ -2660,13 +2712,13 @@ async def begin_delete_mongo_db_collection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_mongo_db_collection_initial( # type: ignore resource_group_name=resource_group_name, @@ -2686,7 +2738,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2698,9 +2750,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_mongo_db_collection.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}"} # type: ignore + begin_delete_mongo_db_collection.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}" + } async def _list_mongo_db_collection_partition_merge_initial( self, @@ -2722,11 +2776,11 @@ async def _list_mongo_db_collection_partition_merge_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionStorageInfoCollection]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionStorageInfoCollection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2751,9 +2805,9 @@ async def _list_mongo_db_collection_partition_merge_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2772,7 +2826,9 @@ async def _list_mongo_db_collection_partition_merge_initial( return deserialized - _list_mongo_db_collection_partition_merge_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge"} # type: ignore + _list_mongo_db_collection_partition_merge_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge" + } @overload async def begin_list_mongo_db_collection_partition_merge( @@ -2904,16 +2960,16 @@ async def begin_list_mongo_db_collection_partition_merge( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionStorageInfoCollection] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + 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( # type: ignore + raw_result = await self._list_mongo_db_collection_partition_merge_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2935,9 +2991,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2949,9 +3005,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_list_mongo_db_collection_partition_merge.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge"} # type: ignore + begin_list_mongo_db_collection_partition_merge.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge" + } @distributed_trace_async async def get_mongo_db_collection_throughput( @@ -2985,10 +3043,10 @@ async def get_mongo_db_collection_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_mongo_db_collection_throughput_request( resource_group_name=resource_group_name, @@ -3002,9 +3060,9 @@ async def get_mongo_db_collection_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3021,7 +3079,9 @@ async def get_mongo_db_collection_throughput( return deserialized - get_mongo_db_collection_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default"} # type: ignore + get_mongo_db_collection_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default" + } async def _update_mongo_db_collection_throughput_initial( self, @@ -3043,11 +3103,11 @@ async def _update_mongo_db_collection_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -3072,9 +3132,9 @@ async def _update_mongo_db_collection_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3093,7 +3153,9 @@ async def _update_mongo_db_collection_throughput_initial( return deserialized - _update_mongo_db_collection_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default"} # type: ignore + _update_mongo_db_collection_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default" + } @overload async def begin_update_mongo_db_collection_throughput( @@ -3229,16 +3291,16 @@ async def begin_update_mongo_db_collection_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_mongo_db_collection_throughput_initial( # type: ignore + raw_result = await self._update_mongo_db_collection_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3260,7 +3322,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3272,9 +3334,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_mongo_db_collection_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default"} # type: ignore + begin_update_mongo_db_collection_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default" + } async def _migrate_mongo_db_collection_to_autoscale_initial( self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any @@ -3290,10 +3354,10 @@ async def _migrate_mongo_db_collection_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_mongo_db_collection_to_autoscale_request( resource_group_name=resource_group_name, @@ -3307,9 +3371,9 @@ async def _migrate_mongo_db_collection_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3328,7 +3392,9 @@ async def _migrate_mongo_db_collection_to_autoscale_initial( return deserialized - _migrate_mongo_db_collection_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_mongo_db_collection_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace_async async def begin_migrate_mongo_db_collection_to_autoscale( @@ -3362,15 +3428,15 @@ async def begin_migrate_mongo_db_collection_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_mongo_db_collection_to_autoscale_initial( # type: ignore + raw_result = await self._migrate_mongo_db_collection_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3390,7 +3456,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3402,9 +3468,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_mongo_db_collection_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_mongo_db_collection_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToAutoscale" + } async def _migrate_mongo_db_collection_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any @@ -3420,10 +3488,10 @@ async def _migrate_mongo_db_collection_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_mongo_db_collection_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -3437,9 +3505,9 @@ async def _migrate_mongo_db_collection_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3458,7 +3526,9 @@ async def _migrate_mongo_db_collection_to_manual_throughput_initial( return deserialized - _migrate_mongo_db_collection_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_mongo_db_collection_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace_async async def begin_migrate_mongo_db_collection_to_manual_throughput( @@ -3492,15 +3562,15 @@ async def begin_migrate_mongo_db_collection_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_mongo_db_collection_to_manual_throughput_initial( # type: ignore + raw_result = await self._migrate_mongo_db_collection_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3520,7 +3590,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3532,9 +3602,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_mongo_db_collection_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_mongo_db_collection_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace_async async def get_mongo_role_definition( @@ -3566,10 +3638,10 @@ async def get_mongo_role_definition( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoRoleDefinitionGetResults] + ) + cls: ClsType[_models.MongoRoleDefinitionGetResults] = kwargs.pop("cls", None) request = build_get_mongo_role_definition_request( mongo_role_definition_id=mongo_role_definition_id, @@ -3582,9 +3654,9 @@ async def get_mongo_role_definition( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3601,7 +3673,9 @@ async def get_mongo_role_definition( return deserialized - get_mongo_role_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}"} # type: ignore + get_mongo_role_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}" + } async def _create_update_mongo_role_definition_initial( self, @@ -3622,11 +3696,11 @@ async def _create_update_mongo_role_definition_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.MongoRoleDefinitionGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.MongoRoleDefinitionGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -3652,9 +3726,9 @@ async def _create_update_mongo_role_definition_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3673,7 +3747,9 @@ async def _create_update_mongo_role_definition_initial( return deserialized - _create_update_mongo_role_definition_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}"} # type: ignore + _create_update_mongo_role_definition_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}" + } @overload async def begin_create_update_mongo_role_definition( @@ -3800,16 +3876,16 @@ async def begin_create_update_mongo_role_definition( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoRoleDefinitionGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MongoRoleDefinitionGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_mongo_role_definition_initial( # type: ignore + raw_result = await self._create_update_mongo_role_definition_initial( mongo_role_definition_id=mongo_role_definition_id, resource_group_name=resource_group_name, account_name=account_name, @@ -3830,7 +3906,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3842,9 +3918,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_mongo_role_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}"} # type: ignore + begin_create_update_mongo_role_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}" + } async def _delete_mongo_role_definition_initial( # pylint: disable=inconsistent-return-statements self, mongo_role_definition_id: str, resource_group_name: str, account_name: str, **kwargs: Any @@ -3860,10 +3938,10 @@ async def _delete_mongo_role_definition_initial( # pylint: disable=inconsistent _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_mongo_role_definition_request( mongo_role_definition_id=mongo_role_definition_id, @@ -3876,9 +3954,9 @@ async def _delete_mongo_role_definition_initial( # pylint: disable=inconsistent params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3891,7 +3969,9 @@ async def _delete_mongo_role_definition_initial( # pylint: disable=inconsistent if cls: return cls(pipeline_response, None, {}) - _delete_mongo_role_definition_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}"} # type: ignore + _delete_mongo_role_definition_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}" + } @distributed_trace_async async def begin_delete_mongo_role_definition( @@ -3921,13 +4001,13 @@ async def begin_delete_mongo_role_definition( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_mongo_role_definition_initial( # type: ignore mongo_role_definition_id=mongo_role_definition_id, @@ -3946,7 +4026,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3958,9 +4038,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_mongo_role_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}"} # type: ignore + begin_delete_mongo_role_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}" + } @distributed_trace def list_mongo_role_definitions( @@ -3983,10 +4065,10 @@ def list_mongo_role_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoRoleDefinitionListResult] + ) + cls: ClsType[_models.MongoRoleDefinitionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -4009,7 +4091,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -4025,7 +4107,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -4033,13 +4115,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("MongoRoleDefinitionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -4052,7 +4134,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_mongo_role_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions"} # type: ignore + list_mongo_role_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions" + } @distributed_trace_async async def get_mongo_user_definition( @@ -4084,10 +4168,10 @@ async def get_mongo_user_definition( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoUserDefinitionGetResults] + ) + cls: ClsType[_models.MongoUserDefinitionGetResults] = kwargs.pop("cls", None) request = build_get_mongo_user_definition_request( mongo_user_definition_id=mongo_user_definition_id, @@ -4100,9 +4184,9 @@ async def get_mongo_user_definition( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4119,7 +4203,9 @@ async def get_mongo_user_definition( return deserialized - get_mongo_user_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}"} # type: ignore + get_mongo_user_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}" + } async def _create_update_mongo_user_definition_initial( self, @@ -4140,11 +4226,11 @@ async def _create_update_mongo_user_definition_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.MongoUserDefinitionGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.MongoUserDefinitionGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -4170,9 +4256,9 @@ async def _create_update_mongo_user_definition_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4191,7 +4277,9 @@ async def _create_update_mongo_user_definition_initial( return deserialized - _create_update_mongo_user_definition_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}"} # type: ignore + _create_update_mongo_user_definition_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}" + } @overload async def begin_create_update_mongo_user_definition( @@ -4318,16 +4406,16 @@ async def begin_create_update_mongo_user_definition( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoUserDefinitionGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MongoUserDefinitionGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_mongo_user_definition_initial( # type: ignore + raw_result = await self._create_update_mongo_user_definition_initial( mongo_user_definition_id=mongo_user_definition_id, resource_group_name=resource_group_name, account_name=account_name, @@ -4348,7 +4436,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -4360,9 +4448,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_mongo_user_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}"} # type: ignore + begin_create_update_mongo_user_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}" + } async def _delete_mongo_user_definition_initial( # pylint: disable=inconsistent-return-statements self, mongo_user_definition_id: str, resource_group_name: str, account_name: str, **kwargs: Any @@ -4378,10 +4468,10 @@ async def _delete_mongo_user_definition_initial( # pylint: disable=inconsistent _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_mongo_user_definition_request( mongo_user_definition_id=mongo_user_definition_id, @@ -4394,9 +4484,9 @@ async def _delete_mongo_user_definition_initial( # pylint: disable=inconsistent params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4409,7 +4499,9 @@ async def _delete_mongo_user_definition_initial( # pylint: disable=inconsistent if cls: return cls(pipeline_response, None, {}) - _delete_mongo_user_definition_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}"} # type: ignore + _delete_mongo_user_definition_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}" + } @distributed_trace_async async def begin_delete_mongo_user_definition( @@ -4439,13 +4531,13 @@ async def begin_delete_mongo_user_definition( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_mongo_user_definition_initial( # type: ignore mongo_user_definition_id=mongo_user_definition_id, @@ -4464,7 +4556,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -4476,9 +4568,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_mongo_user_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}"} # type: ignore + begin_delete_mongo_user_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}" + } @distributed_trace def list_mongo_user_definitions( @@ -4501,10 +4595,10 @@ def list_mongo_user_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoUserDefinitionListResult] + ) + cls: ClsType[_models.MongoUserDefinitionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -4527,7 +4621,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -4543,7 +4637,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -4551,13 +4645,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("MongoUserDefinitionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -4570,7 +4664,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_mongo_user_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions"} # type: ignore + list_mongo_user_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions" + } async def _retrieve_continuous_backup_information_initial( self, @@ -4592,11 +4688,11 @@ async def _retrieve_continuous_backup_information_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.BackupInformation]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BackupInformation]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -4621,9 +4717,9 @@ async def _retrieve_continuous_backup_information_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4642,7 +4738,9 @@ async def _retrieve_continuous_backup_information_initial( return deserialized - _retrieve_continuous_backup_information_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/retrieveContinuousBackupInformation"} # type: ignore + _retrieve_continuous_backup_information_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/retrieveContinuousBackupInformation" + } @overload async def begin_retrieve_continuous_backup_information( @@ -4771,16 +4869,16 @@ async def begin_retrieve_continuous_backup_information( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupInformation] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackupInformation] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._retrieve_continuous_backup_information_initial( # type: ignore + raw_result = await self._retrieve_continuous_backup_information_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -4802,9 +4900,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -4816,6 +4914,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_retrieve_continuous_backup_information.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/retrieveContinuousBackupInformation"} # type: ignore + begin_retrieve_continuous_backup_information.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/retrieveContinuousBackupInformation" + } 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 28205c6250ea..cfad4509f93d 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 @@ -87,10 +87,10 @@ def list_by_database_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NotebookWorkspaceListResult] + ) + cls: ClsType[_models.NotebookWorkspaceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -113,7 +113,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -129,7 +129,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -137,13 +137,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("NotebookWorkspaceListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -157,7 +157,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database_account.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces"} # type: ignore + list_by_database_account.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces" + } @distributed_trace_async async def get( @@ -193,10 +195,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NotebookWorkspace] + ) + cls: ClsType[_models.NotebookWorkspace] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -209,9 +211,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -229,7 +231,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}" + } async def _create_or_update_initial( self, @@ -250,11 +254,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NotebookWorkspace] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NotebookWorkspace] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -278,9 +282,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -298,7 +302,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}" + } @overload async def begin_create_or_update( @@ -425,16 +431,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NotebookWorkspace] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NotebookWorkspace] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, account_name=account_name, notebook_workspace_name=notebook_workspace_name, @@ -455,7 +461,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -467,9 +473,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -489,10 +497,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -505,9 +513,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -521,7 +529,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}" + } @distributed_trace_async async def begin_delete( @@ -556,13 +566,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -581,7 +591,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -593,9 +603,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}" + } @distributed_trace_async async def list_connection_info( @@ -631,10 +643,10 @@ async def list_connection_info( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NotebookWorkspaceConnectionInfoResult] + ) + cls: ClsType[_models.NotebookWorkspaceConnectionInfoResult] = kwargs.pop("cls", None) request = build_list_connection_info_request( resource_group_name=resource_group_name, @@ -647,9 +659,9 @@ async def list_connection_info( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -667,7 +679,9 @@ async def list_connection_info( return deserialized - list_connection_info.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/listConnectionInfo"} # type: ignore + list_connection_info.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/listConnectionInfo" + } async def _regenerate_auth_token_initial( # pylint: disable=inconsistent-return-statements self, @@ -687,10 +701,10 @@ async def _regenerate_auth_token_initial( # pylint: disable=inconsistent-return _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_regenerate_auth_token_request( resource_group_name=resource_group_name, @@ -703,9 +717,9 @@ async def _regenerate_auth_token_initial( # pylint: disable=inconsistent-return params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -719,7 +733,9 @@ async def _regenerate_auth_token_initial( # pylint: disable=inconsistent-return if cls: return cls(pipeline_response, None, {}) - _regenerate_auth_token_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken"} # type: ignore + _regenerate_auth_token_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken" + } @distributed_trace_async async def begin_regenerate_auth_token( @@ -754,13 +770,13 @@ async def begin_regenerate_auth_token( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._regenerate_auth_token_initial( # type: ignore resource_group_name=resource_group_name, @@ -779,7 +795,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -791,9 +807,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_regenerate_auth_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken"} # type: ignore + begin_regenerate_auth_token.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken" + } async def _start_initial( # pylint: disable=inconsistent-return-statements self, @@ -813,10 +831,10 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_start_request( resource_group_name=resource_group_name, @@ -829,9 +847,9 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -845,7 +863,9 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/start"} # type: ignore + _start_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/start" + } @distributed_trace_async async def begin_start( @@ -880,13 +900,13 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._start_initial( # type: ignore resource_group_name=resource_group_name, @@ -905,7 +925,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -917,6 +937,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/start"} # type: ignore + begin_start.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/start" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_operations.py index fc94e37006bf..38eeba5413d5 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_operations.py @@ -69,10 +69,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] + ) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -92,7 +92,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -108,7 +108,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -116,13 +116,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -135,4 +135,4 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.DocumentDB/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.DocumentDB/operations"} diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_partition_key_range_id_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_partition_key_range_id_operations.py index 163426b27448..aa7a765e6731 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_partition_key_range_id_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_partition_key_range_id_operations.py @@ -93,10 +93,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PartitionMetricListResult] + ) + cls: ClsType[_models.PartitionMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -123,7 +123,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -139,7 +139,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -147,13 +147,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("PartitionMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -166,4 +166,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_partition_key_range_id_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_partition_key_range_id_region_operations.py index 50a7915bb7b6..cfa4b5d3cf2d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_partition_key_range_id_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_partition_key_range_id_region_operations.py @@ -97,10 +97,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PartitionMetricListResult] + ) + cls: ClsType[_models.PartitionMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -128,7 +128,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -144,7 +144,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -152,13 +152,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("PartitionMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -171,4 +171,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_operations.py index 97c4c2cefa9d..67faed627efd 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_operations.py @@ -81,10 +81,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PercentileMetricListResult] + ) + cls: ClsType[_models.PercentileMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -108,7 +108,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -124,7 +124,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -132,13 +132,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("PercentileMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -151,4 +151,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/percentile/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/percentile/metrics" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_source_target_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_source_target_operations.py index e7cc706de2a4..db080da50673 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_source_target_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_source_target_operations.py @@ -93,10 +93,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PercentileMetricListResult] + ) + cls: ClsType[_models.PercentileMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -122,7 +122,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -138,7 +138,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -146,13 +146,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("PercentileMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -165,4 +165,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sourceRegion/{sourceRegion}/targetRegion/{targetRegion}/percentile/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sourceRegion/{sourceRegion}/targetRegion/{targetRegion}/percentile/metrics" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_target_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_target_operations.py index 39aa19a07c53..85e3107d5c57 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_target_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_target_operations.py @@ -84,10 +84,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PercentileMetricListResult] + ) + cls: ClsType[_models.PercentileMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -112,7 +112,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -128,7 +128,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -136,13 +136,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("PercentileMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -155,4 +155,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/targetRegion/{targetRegion}/percentile/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/targetRegion/{targetRegion}/percentile/metrics" + } 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 d79bf1fc3e52..7c0e7d29c166 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 @@ -86,10 +86,10 @@ def list_by_database_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] + ) + cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -112,7 +112,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -128,7 +128,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -136,13 +136,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -155,7 +155,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database_account.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections"} # type: ignore + list_by_database_account.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections" + } @distributed_trace_async async def get( @@ -186,10 +188,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] + ) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -202,9 +204,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -221,7 +223,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" + } async def _create_or_update_initial( self, @@ -242,11 +246,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PrivateEndpointConnection]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PrivateEndpointConnection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -270,9 +274,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -292,7 +296,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @overload async def begin_create_or_update( @@ -414,16 +420,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, account_name=account_name, private_endpoint_connection_name=private_endpoint_connection_name, @@ -444,7 +450,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -456,9 +462,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, private_endpoint_connection_name: str, **kwargs: Any @@ -474,10 +482,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -490,9 +498,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -506,7 +514,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @distributed_trace_async async def begin_delete( @@ -536,13 +546,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -561,7 +571,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -573,6 +583,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_private_link_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_private_link_resources_operations.py index 3f74aafee8de..b756a6179022 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_private_link_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_private_link_resources_operations.py @@ -78,10 +78,10 @@ def list_by_database_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] + ) + cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -104,7 +104,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -120,7 +120,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -128,13 +128,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -147,7 +147,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database_account.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateLinkResources"} # type: ignore + list_by_database_account.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateLinkResources" + } @distributed_trace_async async def get( @@ -178,10 +180,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResource] + ) + cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -194,9 +196,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -213,4 +215,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateLinkResources/{groupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateLinkResources/{groupName}" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_database_accounts_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_database_accounts_operations.py index 42a6eb44655e..bf878fd26410 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_database_accounts_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_database_accounts_operations.py @@ -83,10 +83,10 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDatabaseAccountsListResult] + ) + cls: ClsType[_models.RestorableDatabaseAccountsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -108,7 +108,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -124,7 +124,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -132,13 +132,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableDatabaseAccountsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -151,7 +151,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts" + } @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.RestorableDatabaseAccountGetResult"]: @@ -168,10 +170,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.RestorableDatabaseAccoun _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDatabaseAccountsListResult] + ) + cls: ClsType[_models.RestorableDatabaseAccountsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -192,7 +194,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -208,7 +210,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -216,13 +218,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableDatabaseAccountsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -235,7 +237,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/restorableDatabaseAccounts"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/restorableDatabaseAccounts"} @distributed_trace_async async def get_by_location( @@ -265,10 +267,10 @@ async def get_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDatabaseAccountGetResult] + ) + cls: ClsType[_models.RestorableDatabaseAccountGetResult] = kwargs.pop("cls", None) request = build_get_by_location_request( location=location, @@ -280,9 +282,9 @@ async def get_by_location( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -299,4 +301,6 @@ async def get_by_location( return deserialized - get_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}"} # type: ignore + get_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_gremlin_databases_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_gremlin_databases_operations.py index 9ffd2d6e7b6a..7eff9a02b120 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_gremlin_databases_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_gremlin_databases_operations.py @@ -81,10 +81,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableGremlinDatabasesListResult] + ) + cls: ClsType[_models.RestorableGremlinDatabasesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -107,7 +107,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -123,7 +123,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -131,13 +131,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableGremlinDatabasesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -150,4 +150,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinDatabases"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinDatabases" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_gremlin_graphs_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_gremlin_graphs_operations.py index b11afe582572..ba96ab96a2a2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_gremlin_graphs_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_gremlin_graphs_operations.py @@ -93,10 +93,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableGremlinGraphsListResult] + ) + cls: ClsType[_models.RestorableGremlinGraphsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -122,7 +122,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -138,7 +138,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -146,13 +146,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableGremlinGraphsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -165,4 +165,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGraphs"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGraphs" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_gremlin_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_gremlin_resources_operations.py index 4bd33c6dbdeb..6cb3ca279796 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_gremlin_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_gremlin_resources_operations.py @@ -92,10 +92,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableGremlinResourcesListResult] + ) + cls: ClsType[_models.RestorableGremlinResourcesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -120,7 +120,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -136,7 +136,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -144,13 +144,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableGremlinResourcesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -163,4 +163,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinResources"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinResources" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_collections_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_collections_operations.py index 7fe523e667fe..238ee3ab27d2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_collections_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_collections_operations.py @@ -93,10 +93,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableMongodbCollectionsListResult] + ) + cls: ClsType[_models.RestorableMongodbCollectionsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -122,7 +122,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -138,7 +138,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -146,13 +146,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableMongodbCollectionsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -165,4 +165,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbCollections"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbCollections" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_databases_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_databases_operations.py index 28977cd2b3eb..dde84d9a63e3 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_databases_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_databases_operations.py @@ -81,10 +81,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableMongodbDatabasesListResult] + ) + cls: ClsType[_models.RestorableMongodbDatabasesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -107,7 +107,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -123,7 +123,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -131,13 +131,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableMongodbDatabasesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -150,4 +150,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbDatabases"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbDatabases" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_resources_operations.py index 4ee7e84fd2fb..9d2f6e93741e 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_resources_operations.py @@ -92,10 +92,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableMongodbResourcesListResult] + ) + cls: ClsType[_models.RestorableMongodbResourcesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -120,7 +120,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -136,7 +136,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -144,13 +144,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableMongodbResourcesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -163,4 +163,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbResources"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbResources" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_containers_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_containers_operations.py index 7b2c3af2f4d1..acc238acfdd2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_containers_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_containers_operations.py @@ -92,10 +92,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableSqlContainersListResult] + ) + cls: ClsType[_models.RestorableSqlContainersListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -121,7 +121,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -137,7 +137,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -145,13 +145,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableSqlContainersListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -164,4 +164,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlContainers"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlContainers" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_databases_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_databases_operations.py index d27cced217ae..afcff3c60096 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_databases_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_databases_operations.py @@ -81,10 +81,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableSqlDatabasesListResult] + ) + cls: ClsType[_models.RestorableSqlDatabasesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -107,7 +107,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -123,7 +123,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -131,13 +131,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableSqlDatabasesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -150,4 +150,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlDatabases"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlDatabases" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_resources_operations.py index 65124eaf723a..02a2c8243d0a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_resources_operations.py @@ -92,10 +92,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableSqlResourcesListResult] + ) + cls: ClsType[_models.RestorableSqlResourcesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -120,7 +120,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -136,7 +136,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -144,13 +144,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableSqlResourcesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -163,4 +163,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlResources"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlResources" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_table_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_table_resources_operations.py index c37e1426f095..6af191403615 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_table_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_table_resources_operations.py @@ -91,10 +91,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableTableResourcesListResult] + ) + cls: ClsType[_models.RestorableTableResourcesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -119,7 +119,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -135,7 +135,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -143,13 +143,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableTableResourcesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -162,4 +162,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTableResources"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTableResources" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_tables_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_tables_operations.py index 6d3cf445f193..9771f3ff6a5f 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_tables_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_tables_operations.py @@ -89,10 +89,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableTablesListResult] + ) + cls: ClsType[_models.RestorableTablesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -117,7 +117,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -133,7 +133,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -141,13 +141,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RestorableTablesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -160,4 +160,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTables"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTables" + } 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 51272509c629..9116f164e67e 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 @@ -84,10 +84,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceResourceListResult] + ) + cls: ClsType[_models.ServiceResourceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -110,7 +110,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -126,7 +126,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -134,13 +134,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -153,7 +153,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services" + } async def _create_initial( self, @@ -174,11 +176,11 @@ async def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServiceResource]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServiceResource]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -202,9 +204,9 @@ async def _create_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -223,7 +225,9 @@ async def _create_initial( return deserialized - _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}"} # type: ignore + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}" + } @overload async def begin_create( @@ -345,16 +349,16 @@ async def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceResource] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_initial( # type: ignore + raw_result = await self._create_initial( resource_group_name=resource_group_name, account_name=account_name, service_name=service_name, @@ -375,7 +379,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -387,9 +391,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}"} # type: ignore + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}" + } @distributed_trace_async async def get( @@ -420,10 +426,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceResource] + ) + cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -436,9 +442,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -455,7 +461,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, service_name: str, **kwargs: Any @@ -471,10 +479,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -487,9 +495,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -502,7 +510,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}" + } @distributed_trace_async async def begin_delete( @@ -532,13 +542,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -557,7 +567,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -569,6 +579,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}" + } 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 2f568d744fea..a7703e1648ff 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 @@ -127,10 +127,10 @@ def list_sql_databases( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlDatabaseListResult] + ) + cls: ClsType[_models.SqlDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -153,7 +153,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -169,7 +169,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -177,13 +177,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SqlDatabaseListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -196,7 +196,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_sql_databases.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases"} # type: ignore + list_sql_databases.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases" + } @distributed_trace_async async def get_sql_database( @@ -228,10 +230,10 @@ async def get_sql_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlDatabaseGetResults] + ) + cls: ClsType[_models.SqlDatabaseGetResults] = kwargs.pop("cls", None) request = build_get_sql_database_request( resource_group_name=resource_group_name, @@ -244,9 +246,9 @@ async def get_sql_database( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -263,7 +265,9 @@ async def get_sql_database( return deserialized - get_sql_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}"} # type: ignore + get_sql_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}" + } async def _create_update_sql_database_initial( self, @@ -284,11 +288,11 @@ async def _create_update_sql_database_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlDatabaseGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlDatabaseGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -312,9 +316,9 @@ async def _create_update_sql_database_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -333,7 +337,9 @@ async def _create_update_sql_database_initial( return deserialized - _create_update_sql_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}"} # type: ignore + _create_update_sql_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}" + } @overload async def begin_create_update_sql_database( @@ -457,16 +463,16 @@ async def begin_create_update_sql_database( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlDatabaseGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlDatabaseGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_sql_database_initial( # type: ignore + raw_result = await self._create_update_sql_database_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -487,7 +493,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -499,9 +505,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}"} # type: ignore + begin_create_update_sql_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}" + } async def _delete_sql_database_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -517,10 +525,10 @@ async def _delete_sql_database_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_database_request( resource_group_name=resource_group_name, @@ -533,9 +541,9 @@ async def _delete_sql_database_initial( # pylint: disable=inconsistent-return-s params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -548,7 +556,9 @@ async def _delete_sql_database_initial( # pylint: disable=inconsistent-return-s if cls: return cls(pipeline_response, None, {}) - _delete_sql_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}"} # type: ignore + _delete_sql_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}" + } @distributed_trace_async async def begin_delete_sql_database( @@ -578,13 +588,13 @@ async def begin_delete_sql_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_sql_database_initial( # type: ignore resource_group_name=resource_group_name, @@ -603,7 +613,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -615,9 +625,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}"} # type: ignore + begin_delete_sql_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}" + } @distributed_trace_async async def get_sql_database_throughput( @@ -649,10 +661,10 @@ async def get_sql_database_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_sql_database_throughput_request( resource_group_name=resource_group_name, @@ -665,9 +677,9 @@ async def get_sql_database_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -684,7 +696,9 @@ async def get_sql_database_throughput( return deserialized - get_sql_database_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default"} # type: ignore + get_sql_database_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default" + } async def _update_sql_database_throughput_initial( self, @@ -705,11 +719,11 @@ async def _update_sql_database_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -733,9 +747,9 @@ async def _update_sql_database_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -754,7 +768,9 @@ async def _update_sql_database_throughput_initial( return deserialized - _update_sql_database_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default"} # type: ignore + _update_sql_database_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default" + } @overload async def begin_update_sql_database_throughput( @@ -881,16 +897,16 @@ async def begin_update_sql_database_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_sql_database_throughput_initial( # type: ignore + raw_result = await self._update_sql_database_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -911,7 +927,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -923,9 +939,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_sql_database_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default"} # type: ignore + begin_update_sql_database_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default" + } async def _migrate_sql_database_to_autoscale_initial( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -941,10 +959,10 @@ async def _migrate_sql_database_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_sql_database_to_autoscale_request( resource_group_name=resource_group_name, @@ -957,9 +975,9 @@ async def _migrate_sql_database_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -978,7 +996,9 @@ async def _migrate_sql_database_to_autoscale_initial( return deserialized - _migrate_sql_database_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_sql_database_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace_async async def begin_migrate_sql_database_to_autoscale( @@ -1010,15 +1030,15 @@ async def begin_migrate_sql_database_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_sql_database_to_autoscale_initial( # type: ignore + raw_result = await self._migrate_sql_database_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1037,7 +1057,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1049,9 +1069,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_sql_database_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_sql_database_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale" + } async def _migrate_sql_database_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -1067,10 +1089,10 @@ async def _migrate_sql_database_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_sql_database_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -1083,9 +1105,9 @@ async def _migrate_sql_database_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1104,7 +1126,9 @@ async def _migrate_sql_database_to_manual_throughput_initial( return deserialized - _migrate_sql_database_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_sql_database_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace_async async def begin_migrate_sql_database_to_manual_throughput( @@ -1136,15 +1160,15 @@ async def begin_migrate_sql_database_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_sql_database_to_manual_throughput_initial( # type: ignore + raw_result = await self._migrate_sql_database_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1163,7 +1187,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1175,9 +1199,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_sql_database_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_sql_database_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def list_client_encryption_keys( @@ -1202,10 +1228,10 @@ def list_client_encryption_keys( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClientEncryptionKeysListResult] + ) + cls: ClsType[_models.ClientEncryptionKeysListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1229,7 +1255,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -1245,7 +1271,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1253,13 +1279,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1272,7 +1298,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_client_encryption_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys"} # type: ignore + list_client_encryption_keys.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys" + } @distributed_trace_async async def get_client_encryption_key( @@ -1310,10 +1338,10 @@ async def get_client_encryption_key( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClientEncryptionKeyGetResults] + ) + cls: ClsType[_models.ClientEncryptionKeyGetResults] = kwargs.pop("cls", None) request = build_get_client_encryption_key_request( resource_group_name=resource_group_name, @@ -1327,9 +1355,9 @@ async def get_client_encryption_key( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1346,7 +1374,9 @@ async def get_client_encryption_key( return deserialized - get_client_encryption_key.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}"} # type: ignore + get_client_encryption_key.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}" + } async def _create_update_client_encryption_key_initial( self, @@ -1368,11 +1398,11 @@ async def _create_update_client_encryption_key_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ClientEncryptionKeyGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ClientEncryptionKeyGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1399,9 +1429,9 @@ async def _create_update_client_encryption_key_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1420,7 +1450,9 @@ async def _create_update_client_encryption_key_initial( return deserialized - _create_update_client_encryption_key_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}"} # type: ignore + _create_update_client_encryption_key_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}" + } @overload async def begin_create_update_client_encryption_key( @@ -1559,16 +1591,16 @@ async def begin_create_update_client_encryption_key( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClientEncryptionKeyGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_client_encryption_key_initial( # type: ignore + raw_result = await self._create_update_client_encryption_key_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1590,7 +1622,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1602,9 +1634,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_client_encryption_key.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}"} # type: ignore + begin_create_update_client_encryption_key.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}" + } @distributed_trace def list_sql_containers( @@ -1629,10 +1663,10 @@ def list_sql_containers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlContainerListResult] + ) + cls: ClsType[_models.SqlContainerListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1656,7 +1690,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -1672,7 +1706,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1680,13 +1714,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SqlContainerListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1699,7 +1733,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_sql_containers.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers"} # type: ignore + list_sql_containers.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers" + } @distributed_trace_async async def get_sql_container( @@ -1732,10 +1768,10 @@ async def get_sql_container( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlContainerGetResults] + ) + cls: ClsType[_models.SqlContainerGetResults] = kwargs.pop("cls", None) request = build_get_sql_container_request( resource_group_name=resource_group_name, @@ -1749,9 +1785,9 @@ async def get_sql_container( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1768,7 +1804,9 @@ async def get_sql_container( return deserialized - get_sql_container.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}"} # type: ignore + get_sql_container.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}" + } async def _create_update_sql_container_initial( self, @@ -1790,11 +1828,11 @@ async def _create_update_sql_container_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlContainerGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlContainerGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1819,9 +1857,9 @@ async def _create_update_sql_container_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1840,7 +1878,9 @@ async def _create_update_sql_container_initial( return deserialized - _create_update_sql_container_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}"} # type: ignore + _create_update_sql_container_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}" + } @overload async def begin_create_update_sql_container( @@ -1973,16 +2013,16 @@ async def begin_create_update_sql_container( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlContainerGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_sql_container_initial( # type: ignore + raw_result = await self._create_update_sql_container_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2004,7 +2044,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2016,9 +2056,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_container.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}"} # type: ignore + begin_create_update_sql_container.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}" + } async def _delete_sql_container_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any @@ -2034,10 +2076,10 @@ async def _delete_sql_container_initial( # pylint: disable=inconsistent-return- _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_container_request( resource_group_name=resource_group_name, @@ -2051,9 +2093,9 @@ async def _delete_sql_container_initial( # pylint: disable=inconsistent-return- params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2066,7 +2108,9 @@ async def _delete_sql_container_initial( # pylint: disable=inconsistent-return- if cls: return cls(pipeline_response, None, {}) - _delete_sql_container_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}"} # type: ignore + _delete_sql_container_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}" + } @distributed_trace_async async def begin_delete_sql_container( @@ -2098,13 +2142,13 @@ async def begin_delete_sql_container( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_sql_container_initial( # type: ignore resource_group_name=resource_group_name, @@ -2124,7 +2168,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2136,9 +2180,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_container.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}"} # type: ignore + begin_delete_sql_container.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}" + } async def _list_sql_container_partition_merge_initial( self, @@ -2160,11 +2206,11 @@ async def _list_sql_container_partition_merge_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionStorageInfoCollection]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionStorageInfoCollection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2189,9 +2235,9 @@ async def _list_sql_container_partition_merge_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2210,7 +2256,9 @@ async def _list_sql_container_partition_merge_initial( return deserialized - _list_sql_container_partition_merge_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge"} # type: ignore + _list_sql_container_partition_merge_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge" + } @overload async def begin_list_sql_container_partition_merge( @@ -2342,16 +2390,16 @@ async def begin_list_sql_container_partition_merge( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionStorageInfoCollection] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._list_sql_container_partition_merge_initial( # type: ignore + raw_result = await self._list_sql_container_partition_merge_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2373,9 +2421,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2387,9 +2435,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_list_sql_container_partition_merge.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge"} # type: ignore + begin_list_sql_container_partition_merge.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge" + } @distributed_trace_async async def get_sql_container_throughput( @@ -2423,10 +2473,10 @@ async def get_sql_container_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_sql_container_throughput_request( resource_group_name=resource_group_name, @@ -2440,9 +2490,9 @@ async def get_sql_container_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2459,7 +2509,9 @@ async def get_sql_container_throughput( return deserialized - get_sql_container_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default"} # type: ignore + get_sql_container_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default" + } async def _update_sql_container_throughput_initial( self, @@ -2481,11 +2533,11 @@ async def _update_sql_container_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2510,9 +2562,9 @@ async def _update_sql_container_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2531,7 +2583,9 @@ async def _update_sql_container_throughput_initial( return deserialized - _update_sql_container_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default"} # type: ignore + _update_sql_container_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default" + } @overload async def begin_update_sql_container_throughput( @@ -2667,16 +2721,16 @@ async def begin_update_sql_container_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_sql_container_throughput_initial( # type: ignore + raw_result = await self._update_sql_container_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2698,7 +2752,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2710,9 +2764,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_sql_container_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default"} # type: ignore + begin_update_sql_container_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default" + } async def _migrate_sql_container_to_autoscale_initial( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any @@ -2728,10 +2784,10 @@ async def _migrate_sql_container_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_sql_container_to_autoscale_request( resource_group_name=resource_group_name, @@ -2745,9 +2801,9 @@ async def _migrate_sql_container_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2766,7 +2822,9 @@ async def _migrate_sql_container_to_autoscale_initial( return deserialized - _migrate_sql_container_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_sql_container_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace_async async def begin_migrate_sql_container_to_autoscale( @@ -2800,15 +2858,15 @@ async def begin_migrate_sql_container_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_sql_container_to_autoscale_initial( # type: ignore + raw_result = await self._migrate_sql_container_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2828,7 +2886,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2840,9 +2898,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_sql_container_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_sql_container_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale" + } async def _migrate_sql_container_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any @@ -2858,10 +2918,10 @@ async def _migrate_sql_container_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_sql_container_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -2875,9 +2935,9 @@ async def _migrate_sql_container_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2896,7 +2956,9 @@ async def _migrate_sql_container_to_manual_throughput_initial( return deserialized - _migrate_sql_container_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_sql_container_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace_async async def begin_migrate_sql_container_to_manual_throughput( @@ -2930,15 +2992,15 @@ async def begin_migrate_sql_container_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + 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( # type: ignore + 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, @@ -2958,7 +3020,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2970,9 +3032,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_sql_container_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_sql_container_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput" + } async def _sql_database_retrieve_throughput_distribution_initial( self, @@ -2993,11 +3057,11 @@ async def _sql_database_retrieve_throughput_distribution_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -3021,9 +3085,9 @@ async def _sql_database_retrieve_throughput_distribution_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3042,7 +3106,9 @@ async def _sql_database_retrieve_throughput_distribution_initial( return deserialized - _sql_database_retrieve_throughput_distribution_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + _sql_database_retrieve_throughput_distribution_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution" + } @overload async def begin_sql_database_retrieve_throughput_distribution( @@ -3168,16 +3234,16 @@ async def begin_sql_database_retrieve_throughput_distribution( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._sql_database_retrieve_throughput_distribution_initial( # type: ignore + raw_result = await self._sql_database_retrieve_throughput_distribution_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3198,9 +3264,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3212,9 +3278,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_sql_database_retrieve_throughput_distribution.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + begin_sql_database_retrieve_throughput_distribution.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution" + } async def _sql_database_redistribute_throughput_initial( self, @@ -3235,11 +3303,11 @@ async def _sql_database_redistribute_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -3263,9 +3331,9 @@ async def _sql_database_redistribute_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3284,7 +3352,9 @@ async def _sql_database_redistribute_throughput_initial( return deserialized - _sql_database_redistribute_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/redistributeThroughput"} # type: ignore + _sql_database_redistribute_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/redistributeThroughput" + } @overload async def begin_sql_database_redistribute_throughput( @@ -3411,16 +3481,16 @@ async def begin_sql_database_redistribute_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._sql_database_redistribute_throughput_initial( # type: ignore + raw_result = await self._sql_database_redistribute_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3441,9 +3511,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3455,9 +3525,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_sql_database_redistribute_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/redistributeThroughput"} # type: ignore + begin_sql_database_redistribute_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/redistributeThroughput" + } async def _sql_container_retrieve_throughput_distribution_initial( self, @@ -3479,11 +3551,11 @@ async def _sql_container_retrieve_throughput_distribution_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -3508,9 +3580,9 @@ async def _sql_container_retrieve_throughput_distribution_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3529,7 +3601,9 @@ async def _sql_container_retrieve_throughput_distribution_initial( return deserialized - _sql_container_retrieve_throughput_distribution_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + _sql_container_retrieve_throughput_distribution_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution" + } @overload async def begin_sql_container_retrieve_throughput_distribution( @@ -3664,16 +3738,16 @@ async def begin_sql_container_retrieve_throughput_distribution( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._sql_container_retrieve_throughput_distribution_initial( # type: ignore + raw_result = await self._sql_container_retrieve_throughput_distribution_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3695,9 +3769,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3709,9 +3783,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_sql_container_retrieve_throughput_distribution.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + begin_sql_container_retrieve_throughput_distribution.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution" + } async def _sql_container_redistribute_throughput_initial( self, @@ -3733,11 +3809,11 @@ async def _sql_container_redistribute_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -3762,9 +3838,9 @@ async def _sql_container_redistribute_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3783,7 +3859,9 @@ async def _sql_container_redistribute_throughput_initial( return deserialized - _sql_container_redistribute_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput"} # type: ignore + _sql_container_redistribute_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput" + } @overload async def begin_sql_container_redistribute_throughput( @@ -3919,16 +3997,16 @@ async def begin_sql_container_redistribute_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._sql_container_redistribute_throughput_initial( # type: ignore + raw_result = await self._sql_container_redistribute_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3950,9 +4028,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -3964,9 +4042,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_sql_container_redistribute_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput"} # type: ignore + begin_sql_container_redistribute_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput" + } @distributed_trace def list_sql_stored_procedures( @@ -3993,10 +4073,10 @@ def list_sql_stored_procedures( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlStoredProcedureListResult] + ) + cls: ClsType[_models.SqlStoredProcedureListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -4021,7 +4101,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -4037,7 +4117,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -4045,13 +4125,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SqlStoredProcedureListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -4064,7 +4144,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_sql_stored_procedures.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures"} # type: ignore + list_sql_stored_procedures.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures" + } @distributed_trace_async async def get_sql_stored_procedure( @@ -4105,10 +4187,10 @@ async def get_sql_stored_procedure( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlStoredProcedureGetResults] + ) + cls: ClsType[_models.SqlStoredProcedureGetResults] = kwargs.pop("cls", None) request = build_get_sql_stored_procedure_request( resource_group_name=resource_group_name, @@ -4123,9 +4205,9 @@ async def get_sql_stored_procedure( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4142,7 +4224,9 @@ async def get_sql_stored_procedure( return deserialized - get_sql_stored_procedure.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}"} # type: ignore + get_sql_stored_procedure.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}" + } async def _create_update_sql_stored_procedure_initial( self, @@ -4165,11 +4249,11 @@ async def _create_update_sql_stored_procedure_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlStoredProcedureGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlStoredProcedureGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -4197,9 +4281,9 @@ async def _create_update_sql_stored_procedure_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4218,7 +4302,9 @@ async def _create_update_sql_stored_procedure_initial( return deserialized - _create_update_sql_stored_procedure_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}"} # type: ignore + _create_update_sql_stored_procedure_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}" + } @overload async def begin_create_update_sql_stored_procedure( @@ -4363,16 +4449,16 @@ async def begin_create_update_sql_stored_procedure( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlStoredProcedureGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlStoredProcedureGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_sql_stored_procedure_initial( # type: ignore + raw_result = await self._create_update_sql_stored_procedure_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -4395,7 +4481,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -4407,9 +4493,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_stored_procedure.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}"} # type: ignore + begin_create_update_sql_stored_procedure.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}" + } async def _delete_sql_stored_procedure_initial( # pylint: disable=inconsistent-return-statements self, @@ -4431,10 +4519,10 @@ async def _delete_sql_stored_procedure_initial( # pylint: disable=inconsistent- _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_stored_procedure_request( resource_group_name=resource_group_name, @@ -4449,9 +4537,9 @@ async def _delete_sql_stored_procedure_initial( # pylint: disable=inconsistent- params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4464,7 +4552,9 @@ async def _delete_sql_stored_procedure_initial( # pylint: disable=inconsistent- if cls: return cls(pipeline_response, None, {}) - _delete_sql_stored_procedure_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}"} # type: ignore + _delete_sql_stored_procedure_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}" + } @distributed_trace_async async def begin_delete_sql_stored_procedure( @@ -4504,13 +4594,13 @@ async def begin_delete_sql_stored_procedure( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_sql_stored_procedure_initial( # type: ignore resource_group_name=resource_group_name, @@ -4531,7 +4621,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -4543,9 +4633,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_stored_procedure.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}"} # type: ignore + begin_delete_sql_stored_procedure.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}" + } @distributed_trace def list_sql_user_defined_functions( @@ -4572,10 +4664,10 @@ def list_sql_user_defined_functions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlUserDefinedFunctionListResult] + ) + cls: ClsType[_models.SqlUserDefinedFunctionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -4600,7 +4692,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -4616,7 +4708,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -4624,13 +4716,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SqlUserDefinedFunctionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -4643,7 +4735,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_sql_user_defined_functions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions"} # type: ignore + list_sql_user_defined_functions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions" + } @distributed_trace_async async def get_sql_user_defined_function( @@ -4684,10 +4778,10 @@ async def get_sql_user_defined_function( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlUserDefinedFunctionGetResults] + ) + cls: ClsType[_models.SqlUserDefinedFunctionGetResults] = kwargs.pop("cls", None) request = build_get_sql_user_defined_function_request( resource_group_name=resource_group_name, @@ -4702,9 +4796,9 @@ async def get_sql_user_defined_function( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4721,7 +4815,9 @@ async def get_sql_user_defined_function( return deserialized - get_sql_user_defined_function.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}"} # type: ignore + get_sql_user_defined_function.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}" + } async def _create_update_sql_user_defined_function_initial( self, @@ -4746,11 +4842,11 @@ async def _create_update_sql_user_defined_function_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlUserDefinedFunctionGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlUserDefinedFunctionGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -4778,9 +4874,9 @@ async def _create_update_sql_user_defined_function_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4799,7 +4895,9 @@ async def _create_update_sql_user_defined_function_initial( return deserialized - _create_update_sql_user_defined_function_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}"} # type: ignore + _create_update_sql_user_defined_function_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}" + } @overload async def begin_create_update_sql_user_defined_function( @@ -4946,16 +5044,16 @@ async def begin_create_update_sql_user_defined_function( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlUserDefinedFunctionGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlUserDefinedFunctionGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_sql_user_defined_function_initial( # type: ignore + raw_result = await self._create_update_sql_user_defined_function_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -4978,7 +5076,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -4990,9 +5088,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_user_defined_function.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}"} # type: ignore + begin_create_update_sql_user_defined_function.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}" + } async def _delete_sql_user_defined_function_initial( # pylint: disable=inconsistent-return-statements self, @@ -5014,10 +5114,10 @@ async def _delete_sql_user_defined_function_initial( # pylint: disable=inconsis _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_user_defined_function_request( resource_group_name=resource_group_name, @@ -5032,9 +5132,9 @@ async def _delete_sql_user_defined_function_initial( # pylint: disable=inconsis params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5047,7 +5147,9 @@ async def _delete_sql_user_defined_function_initial( # pylint: disable=inconsis if cls: return cls(pipeline_response, None, {}) - _delete_sql_user_defined_function_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}"} # type: ignore + _delete_sql_user_defined_function_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}" + } @distributed_trace_async async def begin_delete_sql_user_defined_function( @@ -5087,13 +5189,13 @@ async def begin_delete_sql_user_defined_function( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_sql_user_defined_function_initial( # type: ignore resource_group_name=resource_group_name, @@ -5114,7 +5216,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -5126,9 +5228,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_user_defined_function.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}"} # type: ignore + begin_delete_sql_user_defined_function.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}" + } @distributed_trace def list_sql_triggers( @@ -5155,10 +5259,10 @@ def list_sql_triggers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlTriggerListResult] + ) + cls: ClsType[_models.SqlTriggerListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -5183,7 +5287,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -5199,7 +5303,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -5207,13 +5311,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SqlTriggerListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -5226,7 +5330,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_sql_triggers.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers"} # type: ignore + list_sql_triggers.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers" + } @distributed_trace_async async def get_sql_trigger( @@ -5267,10 +5373,10 @@ async def get_sql_trigger( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlTriggerGetResults] + ) + cls: ClsType[_models.SqlTriggerGetResults] = kwargs.pop("cls", None) request = build_get_sql_trigger_request( resource_group_name=resource_group_name, @@ -5285,9 +5391,9 @@ async def get_sql_trigger( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5304,7 +5410,9 @@ async def get_sql_trigger( return deserialized - get_sql_trigger.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}"} # type: ignore + get_sql_trigger.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}" + } async def _create_update_sql_trigger_initial( self, @@ -5327,11 +5435,11 @@ async def _create_update_sql_trigger_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlTriggerGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlTriggerGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -5357,9 +5465,9 @@ async def _create_update_sql_trigger_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5378,7 +5486,9 @@ async def _create_update_sql_trigger_initial( return deserialized - _create_update_sql_trigger_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}"} # type: ignore + _create_update_sql_trigger_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}" + } @overload async def begin_create_update_sql_trigger( @@ -5520,16 +5630,16 @@ async def begin_create_update_sql_trigger( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlTriggerGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlTriggerGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_sql_trigger_initial( # type: ignore + raw_result = await self._create_update_sql_trigger_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -5552,7 +5662,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -5564,9 +5674,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_trigger.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}"} # type: ignore + begin_create_update_sql_trigger.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}" + } async def _delete_sql_trigger_initial( # pylint: disable=inconsistent-return-statements self, @@ -5588,10 +5700,10 @@ async def _delete_sql_trigger_initial( # pylint: disable=inconsistent-return-st _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_trigger_request( resource_group_name=resource_group_name, @@ -5606,9 +5718,9 @@ async def _delete_sql_trigger_initial( # pylint: disable=inconsistent-return-st params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5621,7 +5733,9 @@ async def _delete_sql_trigger_initial( # pylint: disable=inconsistent-return-st if cls: return cls(pipeline_response, None, {}) - _delete_sql_trigger_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}"} # type: ignore + _delete_sql_trigger_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}" + } @distributed_trace_async async def begin_delete_sql_trigger( @@ -5661,13 +5775,13 @@ async def begin_delete_sql_trigger( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_sql_trigger_initial( # type: ignore resource_group_name=resource_group_name, @@ -5688,7 +5802,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -5700,9 +5814,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_trigger.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}"} # type: ignore + begin_delete_sql_trigger.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}" + } @distributed_trace_async async def get_sql_role_definition( @@ -5733,10 +5849,10 @@ async def get_sql_role_definition( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlRoleDefinitionGetResults] + ) + cls: ClsType[_models.SqlRoleDefinitionGetResults] = kwargs.pop("cls", None) request = build_get_sql_role_definition_request( role_definition_id=role_definition_id, @@ -5749,9 +5865,9 @@ async def get_sql_role_definition( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5768,7 +5884,9 @@ async def get_sql_role_definition( return deserialized - get_sql_role_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}"} # type: ignore + get_sql_role_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}" + } async def _create_update_sql_role_definition_initial( self, @@ -5789,11 +5907,11 @@ async def _create_update_sql_role_definition_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlRoleDefinitionGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlRoleDefinitionGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -5819,9 +5937,9 @@ async def _create_update_sql_role_definition_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5840,7 +5958,9 @@ async def _create_update_sql_role_definition_initial( return deserialized - _create_update_sql_role_definition_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}"} # type: ignore + _create_update_sql_role_definition_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}" + } @overload async def begin_create_update_sql_role_definition( @@ -5967,16 +6087,16 @@ async def begin_create_update_sql_role_definition( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlRoleDefinitionGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlRoleDefinitionGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_sql_role_definition_initial( # type: ignore + raw_result = await self._create_update_sql_role_definition_initial( role_definition_id=role_definition_id, resource_group_name=resource_group_name, account_name=account_name, @@ -5997,7 +6117,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -6009,9 +6129,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_role_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}"} # type: ignore + begin_create_update_sql_role_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}" + } async def _delete_sql_role_definition_initial( # pylint: disable=inconsistent-return-statements self, role_definition_id: str, resource_group_name: str, account_name: str, **kwargs: Any @@ -6027,10 +6149,10 @@ async def _delete_sql_role_definition_initial( # pylint: disable=inconsistent-r _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_role_definition_request( role_definition_id=role_definition_id, @@ -6043,9 +6165,9 @@ async def _delete_sql_role_definition_initial( # pylint: disable=inconsistent-r params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -6058,7 +6180,9 @@ async def _delete_sql_role_definition_initial( # pylint: disable=inconsistent-r if cls: return cls(pipeline_response, None, {}) - _delete_sql_role_definition_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}"} # type: ignore + _delete_sql_role_definition_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}" + } @distributed_trace_async async def begin_delete_sql_role_definition( @@ -6088,13 +6212,13 @@ async def begin_delete_sql_role_definition( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_sql_role_definition_initial( # type: ignore role_definition_id=role_definition_id, @@ -6113,7 +6237,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -6125,9 +6249,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_role_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}"} # type: ignore + begin_delete_sql_role_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}" + } @distributed_trace def list_sql_role_definitions( @@ -6150,10 +6276,10 @@ def list_sql_role_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlRoleDefinitionListResult] + ) + cls: ClsType[_models.SqlRoleDefinitionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -6176,7 +6302,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -6192,7 +6318,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -6200,13 +6326,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SqlRoleDefinitionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -6219,7 +6345,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_sql_role_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions"} # type: ignore + list_sql_role_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions" + } @distributed_trace_async async def get_sql_role_assignment( @@ -6250,10 +6378,10 @@ async def get_sql_role_assignment( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlRoleAssignmentGetResults] + ) + cls: ClsType[_models.SqlRoleAssignmentGetResults] = kwargs.pop("cls", None) request = build_get_sql_role_assignment_request( role_assignment_id=role_assignment_id, @@ -6266,9 +6394,9 @@ async def get_sql_role_assignment( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -6285,7 +6413,9 @@ async def get_sql_role_assignment( return deserialized - get_sql_role_assignment.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}"} # type: ignore + get_sql_role_assignment.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}" + } async def _create_update_sql_role_assignment_initial( self, @@ -6306,11 +6436,11 @@ async def _create_update_sql_role_assignment_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlRoleAssignmentGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlRoleAssignmentGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -6336,9 +6466,9 @@ async def _create_update_sql_role_assignment_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -6357,7 +6487,9 @@ async def _create_update_sql_role_assignment_initial( return deserialized - _create_update_sql_role_assignment_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}"} # type: ignore + _create_update_sql_role_assignment_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}" + } @overload async def begin_create_update_sql_role_assignment( @@ -6484,16 +6616,16 @@ async def begin_create_update_sql_role_assignment( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlRoleAssignmentGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlRoleAssignmentGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_sql_role_assignment_initial( # type: ignore + raw_result = await self._create_update_sql_role_assignment_initial( role_assignment_id=role_assignment_id, resource_group_name=resource_group_name, account_name=account_name, @@ -6514,7 +6646,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -6526,9 +6658,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_role_assignment.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}"} # type: ignore + begin_create_update_sql_role_assignment.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}" + } async def _delete_sql_role_assignment_initial( # pylint: disable=inconsistent-return-statements self, role_assignment_id: str, resource_group_name: str, account_name: str, **kwargs: Any @@ -6544,10 +6678,10 @@ async def _delete_sql_role_assignment_initial( # pylint: disable=inconsistent-r _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_role_assignment_request( role_assignment_id=role_assignment_id, @@ -6560,9 +6694,9 @@ async def _delete_sql_role_assignment_initial( # pylint: disable=inconsistent-r params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -6575,7 +6709,9 @@ async def _delete_sql_role_assignment_initial( # pylint: disable=inconsistent-r if cls: return cls(pipeline_response, None, {}) - _delete_sql_role_assignment_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}"} # type: ignore + _delete_sql_role_assignment_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}" + } @distributed_trace_async async def begin_delete_sql_role_assignment( @@ -6605,13 +6741,13 @@ async def begin_delete_sql_role_assignment( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_sql_role_assignment_initial( # type: ignore role_assignment_id=role_assignment_id, @@ -6630,7 +6766,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -6642,9 +6778,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_role_assignment.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}"} # type: ignore + begin_delete_sql_role_assignment.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}" + } @distributed_trace def list_sql_role_assignments( @@ -6667,10 +6805,10 @@ def list_sql_role_assignments( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlRoleAssignmentListResult] + ) + cls: ClsType[_models.SqlRoleAssignmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -6693,7 +6831,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -6709,7 +6847,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -6717,13 +6855,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SqlRoleAssignmentListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -6736,7 +6874,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_sql_role_assignments.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments"} # type: ignore + list_sql_role_assignments.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments" + } async def _retrieve_continuous_backup_information_initial( self, @@ -6758,11 +6898,11 @@ async def _retrieve_continuous_backup_information_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.BackupInformation]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BackupInformation]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -6787,9 +6927,9 @@ async def _retrieve_continuous_backup_information_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -6808,7 +6948,9 @@ async def _retrieve_continuous_backup_information_initial( return deserialized - _retrieve_continuous_backup_information_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/retrieveContinuousBackupInformation"} # type: ignore + _retrieve_continuous_backup_information_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/retrieveContinuousBackupInformation" + } @overload async def begin_retrieve_continuous_backup_information( @@ -6937,16 +7079,16 @@ async def begin_retrieve_continuous_backup_information( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupInformation] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackupInformation] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._retrieve_continuous_backup_information_initial( # type: ignore + raw_result = await self._retrieve_continuous_backup_information_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -6968,9 +7110,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -6982,6 +7124,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_retrieve_continuous_backup_information.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/retrieveContinuousBackupInformation"} # type: ignore + begin_retrieve_continuous_backup_information.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/retrieveContinuousBackupInformation" + } 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 7fb87c8f5e24..28ecfb2356eb 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 @@ -89,10 +89,10 @@ def list_tables( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TableListResult] + ) + cls: ClsType[_models.TableListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -115,7 +115,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -131,7 +131,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -139,13 +139,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("TableListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -158,7 +158,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_tables.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables"} # type: ignore + list_tables.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables" + } @distributed_trace_async async def get_table( @@ -189,10 +191,10 @@ async def get_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TableGetResults] + ) + cls: ClsType[_models.TableGetResults] = kwargs.pop("cls", None) request = build_get_table_request( resource_group_name=resource_group_name, @@ -205,9 +207,9 @@ async def get_table( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -224,7 +226,9 @@ async def get_table( return deserialized - get_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}"} # type: ignore + get_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}" + } async def _create_update_table_initial( self, @@ -245,11 +249,11 @@ async def _create_update_table_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.TableGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.TableGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -273,9 +277,9 @@ async def _create_update_table_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -294,7 +298,9 @@ async def _create_update_table_initial( return deserialized - _create_update_table_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}"} # type: ignore + _create_update_table_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}" + } @overload async def begin_create_update_table( @@ -417,16 +423,16 @@ async def begin_create_update_table( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TableGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TableGetResults] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_table_initial( # type: ignore + raw_result = await self._create_update_table_initial( resource_group_name=resource_group_name, account_name=account_name, table_name=table_name, @@ -447,7 +453,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -459,9 +465,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}"} # type: ignore + begin_create_update_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}" + } async def _delete_table_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, table_name: str, **kwargs: Any @@ -477,10 +485,10 @@ async def _delete_table_initial( # pylint: disable=inconsistent-return-statemen _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_table_request( resource_group_name=resource_group_name, @@ -493,9 +501,9 @@ async def _delete_table_initial( # pylint: disable=inconsistent-return-statemen params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -508,7 +516,9 @@ async def _delete_table_initial( # pylint: disable=inconsistent-return-statemen if cls: return cls(pipeline_response, None, {}) - _delete_table_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}"} # type: ignore + _delete_table_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}" + } @distributed_trace_async async def begin_delete_table( @@ -538,13 +548,13 @@ async def begin_delete_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_table_initial( # type: ignore resource_group_name=resource_group_name, @@ -563,7 +573,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -575,9 +585,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}"} # type: ignore + begin_delete_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}" + } @distributed_trace_async async def get_table_throughput( @@ -609,10 +621,10 @@ async def get_table_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_table_throughput_request( resource_group_name=resource_group_name, @@ -625,9 +637,9 @@ async def get_table_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -644,7 +656,9 @@ async def get_table_throughput( return deserialized - get_table_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default"} # type: ignore + get_table_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default" + } async def _update_table_throughput_initial( self, @@ -665,11 +679,11 @@ async def _update_table_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -693,9 +707,9 @@ async def _update_table_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -714,7 +728,9 @@ async def _update_table_throughput_initial( return deserialized - _update_table_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default"} # type: ignore + _update_table_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default" + } @overload async def begin_update_table_throughput( @@ -841,16 +857,16 @@ async def begin_update_table_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_table_throughput_initial( # type: ignore + raw_result = await self._update_table_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, table_name=table_name, @@ -871,7 +887,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -883,9 +899,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_table_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default"} # type: ignore + begin_update_table_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default" + } async def _migrate_table_to_autoscale_initial( self, resource_group_name: str, account_name: str, table_name: str, **kwargs: Any @@ -901,10 +919,10 @@ async def _migrate_table_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_table_to_autoscale_request( resource_group_name=resource_group_name, @@ -917,9 +935,9 @@ async def _migrate_table_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -938,7 +956,9 @@ async def _migrate_table_to_autoscale_initial( return deserialized - _migrate_table_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_table_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace_async async def begin_migrate_table_to_autoscale( @@ -970,15 +990,15 @@ async def begin_migrate_table_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_table_to_autoscale_initial( # type: ignore + raw_result = await self._migrate_table_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, table_name=table_name, @@ -997,7 +1017,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1009,9 +1029,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_table_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_table_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale" + } async def _migrate_table_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, table_name: str, **kwargs: Any @@ -1027,10 +1049,10 @@ async def _migrate_table_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_table_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -1043,9 +1065,9 @@ async def _migrate_table_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1064,7 +1086,9 @@ async def _migrate_table_to_manual_throughput_initial( return deserialized - _migrate_table_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_table_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace_async async def begin_migrate_table_to_manual_throughput( @@ -1096,15 +1120,15 @@ async def begin_migrate_table_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._migrate_table_to_manual_throughput_initial( # type: ignore + raw_result = await self._migrate_table_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, table_name=table_name, @@ -1123,7 +1147,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1135,9 +1159,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_table_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_table_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput" + } async def _retrieve_continuous_backup_information_initial( self, @@ -1158,11 +1184,11 @@ async def _retrieve_continuous_backup_information_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.BackupInformation]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BackupInformation]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1186,9 +1212,9 @@ async def _retrieve_continuous_backup_information_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1207,7 +1233,9 @@ async def _retrieve_continuous_backup_information_initial( return deserialized - _retrieve_continuous_backup_information_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/retrieveContinuousBackupInformation"} # type: ignore + _retrieve_continuous_backup_information_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/retrieveContinuousBackupInformation" + } @overload async def begin_retrieve_continuous_backup_information( @@ -1327,16 +1355,16 @@ async def begin_retrieve_continuous_backup_information( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupInformation] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackupInformation] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._retrieve_continuous_backup_information_initial( # type: ignore + raw_result = await self._retrieve_continuous_backup_information_initial( resource_group_name=resource_group_name, account_name=account_name, table_name=table_name, @@ -1357,9 +1385,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1371,6 +1399,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_retrieve_continuous_backup_information.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/retrieveContinuousBackupInformation"} # type: ignore + begin_retrieve_continuous_backup_information.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/retrieveContinuousBackupInformation" + } 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 b4f2e142fde6..5372d6ec060d 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 @@ -11,7 +11,6 @@ from ._models_py3 import AccountKeyMetadata from ._models_py3 import AnalyticalStorageConfiguration from ._models_py3 import ApiProperties -from ._models_py3 import AuthenticationMethodLdapProperties from ._models_py3 import AutoUpgradePolicyResource from ._models_py3 import AutoscaleSettings from ._models_py3 import AutoscaleSettingsResource @@ -19,13 +18,14 @@ from ._models_py3 import BackupInformation from ._models_py3 import BackupPolicy from ._models_py3 import BackupPolicyMigrationState -from ._models_py3 import BackupResource -from ._models_py3 import BackupResourceProperties from ._models_py3 import Capability from ._models_py3 import Capacity from ._models_py3 import CassandraClusterDataCenterNodeItem from ._models_py3 import CassandraClusterPublicStatus from ._models_py3 import CassandraClusterPublicStatusDataCentersItem +from ._models_py3 import CassandraClusterRepairListFilter +from ._models_py3 import CassandraClusterRepairPublicProperties +from ._models_py3 import CassandraClusterRepairPublicResource from ._models_py3 import CassandraKeyspaceCreateUpdateParameters from ._models_py3 import CassandraKeyspaceGetPropertiesOptions from ._models_py3 import CassandraKeyspaceGetPropertiesResource @@ -33,6 +33,17 @@ from ._models_py3 import CassandraKeyspaceListResult from ._models_py3 import CassandraKeyspaceResource from ._models_py3 import CassandraPartitionKey +from ._models_py3 import CassandraReaperClusterStatus +from ._models_py3 import CassandraReaperEndpointState +from ._models_py3 import CassandraReaperGossipInfo +from ._models_py3 import CassandraReaperNodeStatus +from ._models_py3 import CassandraReaperRunStatus +from ._models_py3 import CassandraReaperRunStatusFeedResponse +from ._models_py3 import CassandraReaperScheduleStatus +from ._models_py3 import CassandraRepairRingRange +from ._models_py3 import CassandraRepairSegment +from ._models_py3 import CassandraRepairSegmentResourceFeedResponse +from ._models_py3 import CassandraRepairTokenRange from ._models_py3 import CassandraSchema from ._models_py3 import CassandraTableCreateUpdateParameters from ._models_py3 import CassandraTableGetPropertiesOptions @@ -128,7 +139,6 @@ from ._models_py3 import IndexingPolicy from ._models_py3 import IpAddressOrRange from ._models_py3 import KeyWrapMetadata -from ._models_py3 import ListBackups from ._models_py3 import ListClusters from ._models_py3 import ListDataCenters from ._models_py3 import Location @@ -317,6 +327,7 @@ from ._cosmos_db_management_client_enums import BackupPolicyMigrationStatus from ._cosmos_db_management_client_enums import BackupPolicyType from ._cosmos_db_management_client_enums import BackupStorageRedundancy +from ._cosmos_db_management_client_enums import CassandraRepairRunStateEnum from ._cosmos_db_management_client_enums import CompositePathSortOrder from ._cosmos_db_management_client_enums import ConflictResolutionMode from ._cosmos_db_management_client_enums import ConnectionState @@ -356,7 +367,7 @@ from ._cosmos_db_management_client_enums import TriggerType from ._cosmos_db_management_client_enums import UnitType from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -365,7 +376,6 @@ "AccountKeyMetadata", "AnalyticalStorageConfiguration", "ApiProperties", - "AuthenticationMethodLdapProperties", "AutoUpgradePolicyResource", "AutoscaleSettings", "AutoscaleSettingsResource", @@ -373,13 +383,14 @@ "BackupInformation", "BackupPolicy", "BackupPolicyMigrationState", - "BackupResource", - "BackupResourceProperties", "Capability", "Capacity", "CassandraClusterDataCenterNodeItem", "CassandraClusterPublicStatus", "CassandraClusterPublicStatusDataCentersItem", + "CassandraClusterRepairListFilter", + "CassandraClusterRepairPublicProperties", + "CassandraClusterRepairPublicResource", "CassandraKeyspaceCreateUpdateParameters", "CassandraKeyspaceGetPropertiesOptions", "CassandraKeyspaceGetPropertiesResource", @@ -387,6 +398,17 @@ "CassandraKeyspaceListResult", "CassandraKeyspaceResource", "CassandraPartitionKey", + "CassandraReaperClusterStatus", + "CassandraReaperEndpointState", + "CassandraReaperGossipInfo", + "CassandraReaperNodeStatus", + "CassandraReaperRunStatus", + "CassandraReaperRunStatusFeedResponse", + "CassandraReaperScheduleStatus", + "CassandraRepairRingRange", + "CassandraRepairSegment", + "CassandraRepairSegmentResourceFeedResponse", + "CassandraRepairTokenRange", "CassandraSchema", "CassandraTableCreateUpdateParameters", "CassandraTableGetPropertiesOptions", @@ -482,7 +504,6 @@ "IndexingPolicy", "IpAddressOrRange", "KeyWrapMetadata", - "ListBackups", "ListClusters", "ListDataCenters", "Location", @@ -670,6 +691,7 @@ "BackupPolicyMigrationStatus", "BackupPolicyType", "BackupStorageRedundancy", + "CassandraRepairRunStateEnum", "CompositePathSortOrder", "ConflictResolutionMode", "ConnectionState", 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 ac1f2e1659fd..31aee17833c3 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 @@ -31,12 +31,11 @@ class ApiType(str, Enum, metaclass=CaseInsensitiveEnumMeta): class AuthenticationMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): """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'. 'Ldap' is in preview. + password based authentication. The default is 'Cassandra'. """ NONE = "None" CASSANDRA = "Cassandra" - LDAP = "Ldap" class BackupPolicyMigrationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -63,6 +62,18 @@ class BackupStorageRedundancy(str, Enum, metaclass=CaseInsensitiveEnumMeta): ZONE = "Zone" +class CassandraRepairRunStateEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Valid states of repair run.""" + + NOT_STARTED = "NOT_STARTED" + RUNNING = "RUNNING" + ERROR = "ERROR" + DONE = "DONE" + PAUSED = "PAUSED" + ABORTED = "ABORTED" + DELETED = "DELETED" + + class CompositePathSortOrder(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Sort order for composite paths.""" 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 5d97d53df9cc..a4d9e548c03c 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 @@ -43,7 +43,7 @@ class AccountKeyMetadata(_serialization.Model): "generation_time": {"key": "generationTime", "type": "iso-8601"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.generation_time = None @@ -61,7 +61,9 @@ class AnalyticalStorageConfiguration(_serialization.Model): "schema_type": {"key": "schemaType", "type": "str"}, } - def __init__(self, *, schema_type: Optional[Union[str, "_models.AnalyticalStorageSchemaType"]] = None, **kwargs): + def __init__( + self, *, schema_type: Optional[Union[str, "_models.AnalyticalStorageSchemaType"]] = None, **kwargs: Any + ) -> None: """ :keyword schema_type: Describes the types of schema for analytical storage. Known values are: "WellDefined" and "FullFidelity". @@ -83,7 +85,7 @@ class ApiProperties(_serialization.Model): "server_version": {"key": "serverVersion", "type": "str"}, } - def __init__(self, *, server_version: Optional[Union[str, "_models.ServerVersion"]] = None, **kwargs): + def __init__(self, *, server_version: Optional[Union[str, "_models.ServerVersion"]] = None, **kwargs: Any) -> None: """ :keyword server_version: Describes the ServerVersion of an a MongoDB account. Known values are: "3.2", "3.6", "4.0", and "4.2". @@ -94,7 +96,8 @@ def __init__(self, *, server_version: Optional[Union[str, "_models.ServerVersion class ARMProxyResource(_serialization.Model): - """The resource model definition for a ARM proxy resource. It will have everything other than required location and tags. + """The resource model definition for a ARM proxy resource. It will have everything other than + required location and tags. Variables are only populated by the server, and will be ignored when sending a request. @@ -118,7 +121,7 @@ class ARMProxyResource(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -171,8 +174,8 @@ def __init__( location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -195,79 +198,6 @@ def __init__( self.identity = identity -class AuthenticationMethodLdapProperties(_serialization.Model): - """Ldap authentication method properties. This feature is in preview. - - :ivar server_hostname: Hostname of the LDAP server. - :vartype server_hostname: str - :ivar server_port: Port of the LDAP server. - :vartype server_port: int - :ivar service_user_distinguished_name: Distinguished name of the look up user account, who can - look up user details on authentication. - :vartype service_user_distinguished_name: str - :ivar service_user_password: Password of the look up user. - :vartype service_user_password: str - :ivar search_base_distinguished_name: Distinguished name of the object to start the recursive - search of users from. - :vartype search_base_distinguished_name: str - :ivar search_filter_template: Template to use for searching. Defaults to (cn=%s) where %s will - be replaced by the username used to login. - :vartype search_filter_template: str - :ivar server_certificates: - :vartype server_certificates: list[~azure.mgmt.cosmosdb.models.Certificate] - """ - - _attribute_map = { - "server_hostname": {"key": "serverHostname", "type": "str"}, - "server_port": {"key": "serverPort", "type": "int"}, - "service_user_distinguished_name": {"key": "serviceUserDistinguishedName", "type": "str"}, - "service_user_password": {"key": "serviceUserPassword", "type": "str"}, - "search_base_distinguished_name": {"key": "searchBaseDistinguishedName", "type": "str"}, - "search_filter_template": {"key": "searchFilterTemplate", "type": "str"}, - "server_certificates": {"key": "serverCertificates", "type": "[Certificate]"}, - } - - def __init__( - self, - *, - server_hostname: Optional[str] = None, - server_port: Optional[int] = None, - service_user_distinguished_name: Optional[str] = None, - service_user_password: Optional[str] = None, - search_base_distinguished_name: Optional[str] = None, - search_filter_template: Optional[str] = None, - server_certificates: Optional[List["_models.Certificate"]] = None, - **kwargs - ): - """ - :keyword server_hostname: Hostname of the LDAP server. - :paramtype server_hostname: str - :keyword server_port: Port of the LDAP server. - :paramtype server_port: int - :keyword service_user_distinguished_name: Distinguished name of the look up user account, who - can look up user details on authentication. - :paramtype service_user_distinguished_name: str - :keyword service_user_password: Password of the look up user. - :paramtype service_user_password: str - :keyword search_base_distinguished_name: Distinguished name of the object to start the - recursive search of users from. - :paramtype search_base_distinguished_name: str - :keyword search_filter_template: Template to use for searching. Defaults to (cn=%s) where %s - will be replaced by the username used to login. - :paramtype search_filter_template: str - :keyword server_certificates: - :paramtype server_certificates: list[~azure.mgmt.cosmosdb.models.Certificate] - """ - super().__init__(**kwargs) - self.server_hostname = server_hostname - self.server_port = server_port - self.service_user_distinguished_name = service_user_distinguished_name - self.service_user_password = service_user_password - self.search_base_distinguished_name = search_base_distinguished_name - self.search_filter_template = search_filter_template - self.server_certificates = server_certificates - - class AutoscaleSettings(_serialization.Model): """AutoscaleSettings. @@ -279,7 +209,7 @@ class AutoscaleSettings(_serialization.Model): "max_throughput": {"key": "maxThroughput", "type": "int"}, } - def __init__(self, *, max_throughput: Optional[int] = None, **kwargs): + def __init__(self, *, max_throughput: Optional[int] = None, **kwargs: Any) -> None: """ :keyword max_throughput: Represents maximum throughput, the resource can scale up to. :paramtype max_throughput: int @@ -320,8 +250,8 @@ def __init__( *, max_throughput: int, auto_upgrade_policy: Optional["_models.AutoUpgradePolicyResource"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword max_throughput: Represents maximum throughput container can scale up to. Required. :paramtype max_throughput: int @@ -346,7 +276,9 @@ class AutoUpgradePolicyResource(_serialization.Model): "throughput_policy": {"key": "throughputPolicy", "type": "ThroughputPolicyResource"}, } - def __init__(self, *, throughput_policy: Optional["_models.ThroughputPolicyResource"] = None, **kwargs): + def __init__( + self, *, throughput_policy: Optional["_models.ThroughputPolicyResource"] = None, **kwargs: Any + ) -> None: """ :keyword throughput_policy: Represents throughput policy which service must adhere to for auto-upgrade. @@ -387,10 +319,10 @@ class DataTransferDataSourceSink(_serialization.Model): } } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.component = None # type: Optional[str] + self.component: Optional[str] = None class AzureBlobDataTransferDataSourceSink(DataTransferDataSourceSink): @@ -418,7 +350,7 @@ class AzureBlobDataTransferDataSourceSink(DataTransferDataSourceSink): "endpoint_url": {"key": "endpointUrl", "type": "str"}, } - def __init__(self, *, container_name: str, endpoint_url: Optional[str] = None, **kwargs): + def __init__(self, *, container_name: str, endpoint_url: Optional[str] = None, **kwargs: Any) -> None: """ :keyword container_name: Required. :paramtype container_name: str @@ -426,7 +358,7 @@ def __init__(self, *, container_name: str, endpoint_url: Optional[str] = None, * :paramtype endpoint_url: str """ super().__init__(**kwargs) - self.component = "AzureBlobStorage" # type: str + self.component: str = "AzureBlobStorage" self.container_name = container_name self.endpoint_url = endpoint_url @@ -448,7 +380,7 @@ class BackupInformation(_serialization.Model): "continuous_backup_information": {"key": "continuousBackupInformation", "type": "ContinuousBackupInformation"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.continuous_backup_information = None @@ -481,14 +413,16 @@ class BackupPolicy(_serialization.Model): _subtype_map = {"type": {"Continuous": "ContinuousModeBackupPolicy", "Periodic": "PeriodicModeBackupPolicy"}} - def __init__(self, *, migration_state: Optional["_models.BackupPolicyMigrationState"] = None, **kwargs): + def __init__( + self, *, migration_state: Optional["_models.BackupPolicyMigrationState"] = 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 """ super().__init__(**kwargs) - self.type = None # type: Optional[str] + self.type: Optional[str] = None self.migration_state = migration_state @@ -517,8 +451,8 @@ def __init__( status: Optional[Union[str, "_models.BackupPolicyMigrationStatus"]] = None, target_type: Optional[Union[str, "_models.BackupPolicyType"]] = None, start_time: Optional[datetime.datetime] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword status: Describes the status of migration between backup policy types. Known values are: "Invalid", "InProgress", "Completed", and "Failed". @@ -535,63 +469,6 @@ def __init__( self.start_time = start_time -class BackupResource(ARMProxyResource): - """A restorable backup of a 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 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: - :vartype properties: ~azure.mgmt.cosmosdb.models.BackupResourceProperties - """ - - _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": "BackupResourceProperties"}, - } - - def __init__(self, *, properties: Optional["_models.BackupResourceProperties"] = None, **kwargs): - """ - :keyword properties: - :paramtype properties: ~azure.mgmt.cosmosdb.models.BackupResourceProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class BackupResourceProperties(_serialization.Model): - """BackupResourceProperties. - - :ivar timestamp: The time this backup was taken, formatted like 2021-01-21T17:35:21. - :vartype timestamp: ~datetime.datetime - """ - - _attribute_map = { - "timestamp": {"key": "timestamp", "type": "iso-8601"}, - } - - def __init__(self, *, timestamp: Optional[datetime.datetime] = None, **kwargs): - """ - :keyword timestamp: The time this backup was taken, formatted like 2021-01-21T17:35:21. - :paramtype timestamp: ~datetime.datetime - """ - super().__init__(**kwargs) - self.timestamp = timestamp - - class Capability(_serialization.Model): """Cosmos DB capability object. @@ -604,7 +481,7 @@ class Capability(_serialization.Model): "name": {"key": "name", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: Name of the Cosmos DB capability. For example, "name": "EnableCassandra". Current values also include "EnableTable" and "EnableGremlin". @@ -632,7 +509,7 @@ class Capacity(_serialization.Model): "total_throughput_limit": {"key": "totalThroughputLimit", "type": "int"}, } - def __init__(self, *, total_throughput_limit: Optional[int] = None, **kwargs): + def __init__(self, *, total_throughput_limit: Optional[int] = None, **kwargs: Any) -> None: """ :keyword total_throughput_limit: The total throughput limit imposed on the account. A totalThroughputLimit of 2000 imposes a strict limit of max throughput that can be provisioned @@ -666,7 +543,7 @@ class CassandraClusterDataCenterNodeItem(_serialization.Model): # pylint: disab :vartype host_id: str :ivar rack: The rack this node is part of. :vartype rack: str - :ivar timestamp: The timestamp at which that snapshot of these usage statistics were taken. + :ivar timestamp: The timestamp when these statistics were captured. :vartype timestamp: str :ivar disk_used_kb: The amount of disk used, in kB, of the directory /var/lib/cassandra. :vartype disk_used_kb: int @@ -723,8 +600,8 @@ def __init__( memory_free_kb: Optional[int] = None, memory_total_kb: Optional[int] = None, cpu_usage: Optional[float] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword address: The node's IP address. :paramtype address: str @@ -745,7 +622,7 @@ def __init__( :paramtype host_id: str :keyword rack: The rack this node is part of. :paramtype rack: str - :keyword timestamp: The timestamp at which that snapshot of these usage statistics were taken. + :keyword timestamp: The timestamp when these statistics were captured. :paramtype timestamp: str :keyword disk_used_kb: The amount of disk used, in kB, of the directory /var/lib/cassandra. :paramtype disk_used_kb: int @@ -813,8 +690,8 @@ def __init__( reaper_status: Optional["_models.ManagedCassandraReaperStatus"] = None, connection_errors: Optional[List["_models.ConnectionError"]] = None, data_centers: Optional[List["_models.CassandraClusterPublicStatusDataCentersItem"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword e_tag: :paramtype e_tag: str @@ -857,8 +734,8 @@ def __init__( name: Optional[str] = None, seed_nodes: Optional[List[str]] = None, nodes: Optional[List["_models.CassandraClusterDataCenterNodeItem"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: The name of this Datacenter. :paramtype name: str @@ -873,6 +750,191 @@ def __init__( self.nodes = nodes +class CassandraClusterRepairListFilter(_serialization.Model): + """Request object to filter list of repair runs. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar keyspace: Keyspace name of the repair run. + :vartype keyspace: str + :ivar repair_run_states: + :vartype repair_run_states: list[str or + ~azure.mgmt.cosmosdb.models.CassandraRepairRunStateEnum] + """ + + _validation = { + "keyspace": {"readonly": True}, + } + + _attribute_map = { + "keyspace": {"key": "keyspace", "type": "str"}, + "repair_run_states": {"key": "repairRunStates", "type": "[str]"}, + } + + def __init__( + self, + *, + repair_run_states: Optional[List[Union[str, "_models.CassandraRepairRunStateEnum"]]] = None, + **kwargs: Any + ) -> None: + """ + :keyword repair_run_states: + :paramtype repair_run_states: list[str or + ~azure.mgmt.cosmosdb.models.CassandraRepairRunStateEnum] + """ + super().__init__(**kwargs) + self.keyspace = None + self.repair_run_states = repair_run_states + + +class CassandraClusterRepairPublicProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes + """CassandraClusterRepairPublicProperties. + + :ivar keyspace: + :vartype keyspace: str + :ivar owner: + :vartype owner: str + :ivar cause: + :vartype cause: str + :ivar tables: + :vartype tables: list[str] + :ivar segment_count: + :vartype segment_count: int + :ivar repair_parallelism: + :vartype repair_parallelism: str + :ivar intensity: + :vartype intensity: float + :ivar incremental_repair: + :vartype incremental_repair: bool + :ivar nodes: + :vartype nodes: list[str] + :ivar data_centers: + :vartype data_centers: list[str] + :ivar black_listed_tables: + :vartype black_listed_tables: list[str] + :ivar repair_thread_count: + :vartype repair_thread_count: int + """ + + _attribute_map = { + "keyspace": {"key": "keyspace", "type": "str"}, + "owner": {"key": "owner", "type": "str"}, + "cause": {"key": "cause", "type": "str"}, + "tables": {"key": "tables", "type": "[str]"}, + "segment_count": {"key": "segmentCount", "type": "int"}, + "repair_parallelism": {"key": "repairParallelism", "type": "str"}, + "intensity": {"key": "intensity", "type": "float"}, + "incremental_repair": {"key": "incrementalRepair", "type": "bool"}, + "nodes": {"key": "nodes", "type": "[str]"}, + "data_centers": {"key": "dataCenters", "type": "[str]"}, + "black_listed_tables": {"key": "blackListedTables", "type": "[str]"}, + "repair_thread_count": {"key": "repairThreadCount", "type": "int"}, + } + + def __init__( + self, + *, + keyspace: Optional[str] = None, + owner: Optional[str] = None, + cause: Optional[str] = None, + tables: Optional[List[str]] = None, + segment_count: Optional[int] = None, + repair_parallelism: Optional[str] = None, + intensity: Optional[float] = None, + incremental_repair: Optional[bool] = None, + nodes: Optional[List[str]] = None, + data_centers: Optional[List[str]] = None, + black_listed_tables: Optional[List[str]] = None, + repair_thread_count: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword keyspace: + :paramtype keyspace: str + :keyword owner: + :paramtype owner: str + :keyword cause: + :paramtype cause: str + :keyword tables: + :paramtype tables: list[str] + :keyword segment_count: + :paramtype segment_count: int + :keyword repair_parallelism: + :paramtype repair_parallelism: str + :keyword intensity: + :paramtype intensity: float + :keyword incremental_repair: + :paramtype incremental_repair: bool + :keyword nodes: + :paramtype nodes: list[str] + :keyword data_centers: + :paramtype data_centers: list[str] + :keyword black_listed_tables: + :paramtype black_listed_tables: list[str] + :keyword repair_thread_count: + :paramtype repair_thread_count: int + """ + super().__init__(**kwargs) + self.keyspace = keyspace + self.owner = owner + self.cause = cause + self.tables = tables + self.segment_count = segment_count + self.repair_parallelism = repair_parallelism + self.intensity = intensity + self.incremental_repair = incremental_repair + self.nodes = nodes + self.data_centers = data_centers + self.black_listed_tables = black_listed_tables + self.repair_thread_count = repair_thread_count + + +class CassandraClusterRepairPublicResource(_serialization.Model): + """CassandraClusterRepairPublicResource. + + :ivar id: + :vartype id: str + :ivar name: + :vartype name: str + :ivar type: + :vartype type: str + :ivar properties: + :vartype properties: ~azure.mgmt.cosmosdb.models.CassandraClusterRepairPublicProperties + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "properties": {"key": "properties", "type": "CassandraClusterRepairPublicProperties"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + type: Optional[str] = None, + properties: Optional["_models.CassandraClusterRepairPublicProperties"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: + :paramtype id: str + :keyword name: + :paramtype name: str + :keyword type: + :paramtype type: str + :keyword properties: + :paramtype properties: ~azure.mgmt.cosmosdb.models.CassandraClusterRepairPublicProperties + """ + super().__init__(**kwargs) + self.id = id + self.name = name + self.type = type + self.properties = properties + + class CassandraKeyspaceCreateUpdateParameters(ARMResourceProperties): """Parameters to create and update Cosmos DB Cassandra keyspace. @@ -930,8 +992,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -975,8 +1037,8 @@ def __init__( *, throughput: Optional[int] = None, autoscale_settings: Optional["_models.AutoscaleSettings"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. @@ -1009,8 +1071,8 @@ def __init__( *, throughput: Optional[int] = None, autoscale_settings: Optional["_models.AutoscaleSettings"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. @@ -1022,7 +1084,8 @@ def __init__( class ExtendedResourceProperties(_serialization.Model): - """The system generated resource properties associated with SQL databases, SQL containers, Gremlin databases and Gremlin graphs. + """The system generated resource properties associated with SQL databases, SQL containers, Gremlin + databases and Gremlin graphs. Variables are only populated by the server, and will be ignored when sending a request. @@ -1047,7 +1110,7 @@ class ExtendedResourceProperties(_serialization.Model): "etag": {"key": "_etag", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.rid = None @@ -1072,7 +1135,7 @@ class CassandraKeyspaceResource(_serialization.Model): "id": {"key": "id", "type": "str"}, } - def __init__(self, *, id: str, **kwargs): # pylint: disable=redefined-builtin + def __init__(self, *, id: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin """ :keyword id: Name of the Cosmos DB Cassandra keyspace. Required. :paramtype id: str @@ -1113,7 +1176,7 @@ class CassandraKeyspaceGetPropertiesResource(CassandraKeyspaceResource, Extended "id": {"key": "id", "type": "str"}, } - def __init__(self, *, id: str, **kwargs): # pylint: disable=redefined-builtin + def __init__(self, *, id: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin """ :keyword id: Name of the Cosmos DB Cassandra keyspace. Required. :paramtype id: str @@ -1178,8 +1241,8 @@ def __init__( identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.CassandraKeyspaceGetPropertiesResource"] = None, options: Optional["_models.CassandraKeyspaceGetPropertiesOptions"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -1219,7 +1282,7 @@ class CassandraKeyspaceListResult(_serialization.Model): "value": {"key": "value", "type": "[CassandraKeyspaceGetResults]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -1236,7 +1299,7 @@ class CassandraPartitionKey(_serialization.Model): "name": {"key": "name", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: Name of the Cosmos DB Cassandra table partition key. :paramtype name: str @@ -1245,6 +1308,749 @@ def __init__(self, *, name: Optional[str] = None, **kwargs): self.name = name +class CassandraReaperClusterStatus(_serialization.Model): + """CassandraReaperClusterStatus. + + :ivar name: + :vartype name: str + :ivar jmx_user_name: + :vartype jmx_user_name: str + :ivar jmx_password_is_set: + :vartype jmx_password_is_set: bool + :ivar seed_hosts: + :vartype seed_hosts: list[str] + :ivar repair_runs: + :vartype repair_runs: list[~azure.mgmt.cosmosdb.models.CassandraReaperRunStatus] + :ivar repair_schedules: + :vartype repair_schedules: list[~azure.mgmt.cosmosdb.models.CassandraReaperScheduleStatus] + :ivar nodes_status: + :vartype nodes_status: ~azure.mgmt.cosmosdb.models.CassandraReaperNodeStatus + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "jmx_user_name": {"key": "jmxUserName", "type": "str"}, + "jmx_password_is_set": {"key": "jmxPasswordIsSet", "type": "bool"}, + "seed_hosts": {"key": "seedHosts", "type": "[str]"}, + "repair_runs": {"key": "repairRuns", "type": "[CassandraReaperRunStatus]"}, + "repair_schedules": {"key": "repairSchedules", "type": "[CassandraReaperScheduleStatus]"}, + "nodes_status": {"key": "nodesStatus", "type": "CassandraReaperNodeStatus"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + jmx_user_name: Optional[str] = None, + jmx_password_is_set: Optional[bool] = None, + seed_hosts: Optional[List[str]] = None, + repair_runs: Optional[List["_models.CassandraReaperRunStatus"]] = None, + repair_schedules: Optional[List["_models.CassandraReaperScheduleStatus"]] = None, + nodes_status: Optional["_models.CassandraReaperNodeStatus"] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: + :paramtype name: str + :keyword jmx_user_name: + :paramtype jmx_user_name: str + :keyword jmx_password_is_set: + :paramtype jmx_password_is_set: bool + :keyword seed_hosts: + :paramtype seed_hosts: list[str] + :keyword repair_runs: + :paramtype repair_runs: list[~azure.mgmt.cosmosdb.models.CassandraReaperRunStatus] + :keyword repair_schedules: + :paramtype repair_schedules: list[~azure.mgmt.cosmosdb.models.CassandraReaperScheduleStatus] + :keyword nodes_status: + :paramtype nodes_status: ~azure.mgmt.cosmosdb.models.CassandraReaperNodeStatus + """ + super().__init__(**kwargs) + self.name = name + self.jmx_user_name = jmx_user_name + self.jmx_password_is_set = jmx_password_is_set + self.seed_hosts = seed_hosts + self.repair_runs = repair_runs + self.repair_schedules = repair_schedules + self.nodes_status = nodes_status + + +class CassandraReaperEndpointState(_serialization.Model): + """CassandraReaperEndpointState. + + :ivar endpoint: + :vartype endpoint: str + :ivar host_id: + :vartype host_id: str + :ivar data_center: + :vartype data_center: str + :ivar rack: + :vartype rack: str + :ivar status: + :vartype status: str + :ivar severity: + :vartype severity: float + :ivar release_version: + :vartype release_version: str + :ivar tokens: + :vartype tokens: str + :ivar load: + :vartype load: float + :ivar type: + :vartype type: str + """ + + _attribute_map = { + "endpoint": {"key": "endpoint", "type": "str"}, + "host_id": {"key": "hostId", "type": "str"}, + "data_center": {"key": "dataCenter", "type": "str"}, + "rack": {"key": "rack", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "severity": {"key": "severity", "type": "float"}, + "release_version": {"key": "releaseVersion", "type": "str"}, + "tokens": {"key": "tokens", "type": "str"}, + "load": {"key": "load", "type": "float"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__( + self, + *, + endpoint: Optional[str] = None, + host_id: Optional[str] = None, + data_center: Optional[str] = None, + rack: Optional[str] = None, + status: Optional[str] = None, + severity: Optional[float] = None, + release_version: Optional[str] = None, + tokens: Optional[str] = None, + load: Optional[float] = None, + type: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword endpoint: + :paramtype endpoint: str + :keyword host_id: + :paramtype host_id: str + :keyword data_center: + :paramtype data_center: str + :keyword rack: + :paramtype rack: str + :keyword status: + :paramtype status: str + :keyword severity: + :paramtype severity: float + :keyword release_version: + :paramtype release_version: str + :keyword tokens: + :paramtype tokens: str + :keyword load: + :paramtype load: float + :keyword type: + :paramtype type: str + """ + super().__init__(**kwargs) + self.endpoint = endpoint + self.host_id = host_id + self.data_center = data_center + self.rack = rack + self.status = status + self.severity = severity + self.release_version = release_version + self.tokens = tokens + self.load = load + self.type = type + + +class CassandraReaperGossipInfo(_serialization.Model): + """CassandraReaperGossipInfo. + + :ivar source_node: + :vartype source_node: str + :ivar endpoints: Dictionary of + . + :vartype endpoints: dict[str, dict[str, + list[~azure.mgmt.cosmosdb.models.CassandraReaperEndpointState]]] + :ivar total_load: + :vartype total_load: float + :ivar endpoint_names: + :vartype endpoint_names: list[str] + """ + + _attribute_map = { + "source_node": {"key": "sourceNode", "type": "str"}, + "endpoints": {"key": "endpoints", "type": "{{[CassandraReaperEndpointState]}}"}, + "total_load": {"key": "totalLoad", "type": "float"}, + "endpoint_names": {"key": "endpointNames", "type": "[str]"}, + } + + def __init__( + self, + *, + source_node: Optional[str] = None, + endpoints: Optional[Dict[str, Dict[str, List["_models.CassandraReaperEndpointState"]]]] = None, + total_load: Optional[float] = None, + endpoint_names: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword source_node: + :paramtype source_node: str + :keyword endpoints: Dictionary of + . + :paramtype endpoints: dict[str, dict[str, + list[~azure.mgmt.cosmosdb.models.CassandraReaperEndpointState]]] + :keyword total_load: + :paramtype total_load: float + :keyword endpoint_names: + :paramtype endpoint_names: list[str] + """ + super().__init__(**kwargs) + self.source_node = source_node + self.endpoints = endpoints + self.total_load = total_load + self.endpoint_names = endpoint_names + + +class CassandraReaperNodeStatus(_serialization.Model): + """CassandraReaperNodeStatus. + + :ivar endpoint_states: + :vartype endpoint_states: list[~azure.mgmt.cosmosdb.models.CassandraReaperGossipInfo] + """ + + _attribute_map = { + "endpoint_states": {"key": "endpointStates", "type": "[CassandraReaperGossipInfo]"}, + } + + def __init__( + self, *, endpoint_states: Optional[List["_models.CassandraReaperGossipInfo"]] = None, **kwargs: Any + ) -> None: + """ + :keyword endpoint_states: + :paramtype endpoint_states: list[~azure.mgmt.cosmosdb.models.CassandraReaperGossipInfo] + """ + super().__init__(**kwargs) + self.endpoint_states = endpoint_states + + +class CassandraReaperRunStatus(_serialization.Model): # pylint: disable=too-many-instance-attributes + """CassandraReaperRunStatus. + + :ivar cause: + :vartype cause: str + :ivar owner: + :vartype owner: str + :ivar id: + :vartype id: str + :ivar cluster_name: + :vartype cluster_name: str + :ivar column_families: + :vartype column_families: list[str] + :ivar keyspace_name: + :vartype keyspace_name: str + :ivar repair_state: + :vartype repair_state: str + :ivar intensity: + :vartype intensity: float + :ivar incremental_repair: + :vartype incremental_repair: bool + :ivar total_segments: + :vartype total_segments: int + :ivar repair_parallelism: + :vartype repair_parallelism: str + :ivar segments_repaired: + :vartype segments_repaired: int + :ivar last_event: + :vartype last_event: str + :ivar duration: + :vartype duration: str + :ivar nodes: + :vartype nodes: list[str] + :ivar datacenters: + :vartype datacenters: list[str] + :ivar blacklisted_tables: + :vartype blacklisted_tables: list[str] + :ivar repair_thread_count: + :vartype repair_thread_count: int + :ivar repair_unit_id: + :vartype repair_unit_id: str + """ + + _attribute_map = { + "cause": {"key": "cause", "type": "str"}, + "owner": {"key": "owner", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "cluster_name": {"key": "clusterName", "type": "str"}, + "column_families": {"key": "columnFamilies", "type": "[str]"}, + "keyspace_name": {"key": "keyspaceName", "type": "str"}, + "repair_state": {"key": "repairState", "type": "str"}, + "intensity": {"key": "intensity", "type": "float"}, + "incremental_repair": {"key": "incrementalRepair", "type": "bool"}, + "total_segments": {"key": "totalSegments", "type": "int"}, + "repair_parallelism": {"key": "repairParallelism", "type": "str"}, + "segments_repaired": {"key": "segmentsRepaired", "type": "int"}, + "last_event": {"key": "lastEvent", "type": "str"}, + "duration": {"key": "duration", "type": "str"}, + "nodes": {"key": "nodes", "type": "[str]"}, + "datacenters": {"key": "datacenters", "type": "[str]"}, + "blacklisted_tables": {"key": "blacklistedTables", "type": "[str]"}, + "repair_thread_count": {"key": "repairThreadCount", "type": "int"}, + "repair_unit_id": {"key": "repairUnitId", "type": "str"}, + } + + def __init__( + self, + *, + cause: Optional[str] = None, + owner: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + cluster_name: Optional[str] = None, + column_families: Optional[List[str]] = None, + keyspace_name: Optional[str] = None, + repair_state: Optional[str] = None, + intensity: Optional[float] = None, + incremental_repair: Optional[bool] = None, + total_segments: Optional[int] = None, + repair_parallelism: Optional[str] = None, + segments_repaired: Optional[int] = None, + last_event: Optional[str] = None, + duration: Optional[str] = None, + nodes: Optional[List[str]] = None, + datacenters: Optional[List[str]] = None, + blacklisted_tables: Optional[List[str]] = None, + repair_thread_count: Optional[int] = None, + repair_unit_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword cause: + :paramtype cause: str + :keyword owner: + :paramtype owner: str + :keyword id: + :paramtype id: str + :keyword cluster_name: + :paramtype cluster_name: str + :keyword column_families: + :paramtype column_families: list[str] + :keyword keyspace_name: + :paramtype keyspace_name: str + :keyword repair_state: + :paramtype repair_state: str + :keyword intensity: + :paramtype intensity: float + :keyword incremental_repair: + :paramtype incremental_repair: bool + :keyword total_segments: + :paramtype total_segments: int + :keyword repair_parallelism: + :paramtype repair_parallelism: str + :keyword segments_repaired: + :paramtype segments_repaired: int + :keyword last_event: + :paramtype last_event: str + :keyword duration: + :paramtype duration: str + :keyword nodes: + :paramtype nodes: list[str] + :keyword datacenters: + :paramtype datacenters: list[str] + :keyword blacklisted_tables: + :paramtype blacklisted_tables: list[str] + :keyword repair_thread_count: + :paramtype repair_thread_count: int + :keyword repair_unit_id: + :paramtype repair_unit_id: str + """ + super().__init__(**kwargs) + self.cause = cause + self.owner = owner + self.id = id + self.cluster_name = cluster_name + self.column_families = column_families + self.keyspace_name = keyspace_name + self.repair_state = repair_state + self.intensity = intensity + self.incremental_repair = incremental_repair + self.total_segments = total_segments + self.repair_parallelism = repair_parallelism + self.segments_repaired = segments_repaired + self.last_event = last_event + self.duration = duration + self.nodes = nodes + self.datacenters = datacenters + self.blacklisted_tables = blacklisted_tables + self.repair_thread_count = repair_thread_count + self.repair_unit_id = repair_unit_id + + +class CassandraReaperRunStatusFeedResponse(_serialization.Model): + """CassandraReaperRunStatusFeedResponse. + + :ivar value: + :vartype value: list[~azure.mgmt.cosmosdb.models.CassandraReaperRunStatus] + """ + + _attribute_map = { + "value": {"key": "value", "type": "[CassandraReaperRunStatus]"}, + } + + def __init__(self, *, value: Optional[List["_models.CassandraReaperRunStatus"]] = None, **kwargs: Any) -> None: + """ + :keyword value: + :paramtype value: list[~azure.mgmt.cosmosdb.models.CassandraReaperRunStatus] + """ + super().__init__(**kwargs) + self.value = value + + +class CassandraReaperScheduleStatus(_serialization.Model): # pylint: disable=too-many-instance-attributes + """CassandraReaperScheduleStatus. + + :ivar id: + :vartype id: str + :ivar owner: + :vartype owner: str + :ivar state: + :vartype state: str + :ivar intensity: + :vartype intensity: float + :ivar cluster_name: + :vartype cluster_name: str + :ivar keyspace_name: + :vartype keyspace_name: str + :ivar column_families: + :vartype column_families: list[str] + :ivar repair_parallelism: + :vartype repair_parallelism: str + :ivar incremental_repair: + :vartype incremental_repair: bool + :ivar scheduled_days_between: + :vartype scheduled_days_between: int + :ivar nodes: + :vartype nodes: list[str] + :ivar datacenters: + :vartype datacenters: list[str] + :ivar blacklisted_tables: + :vartype blacklisted_tables: list[str] + :ivar segment_count_per_node: + :vartype segment_count_per_node: int + :ivar repair_thread_count: + :vartype repair_thread_count: int + :ivar repair_unit_id: + :vartype repair_unit_id: str + :ivar next_activation: + :vartype next_activation: str + :ivar creation_time: + :vartype creation_time: str + :ivar pause_time: + :vartype pause_time: str + :ivar segment_timeout: + :vartype segment_timeout: int + :ivar adaptive: + :vartype adaptive: bool + :ivar percent_unrepaired_threshold: + :vartype percent_unrepaired_threshold: int + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "owner": {"key": "owner", "type": "str"}, + "state": {"key": "state", "type": "str"}, + "intensity": {"key": "intensity", "type": "float"}, + "cluster_name": {"key": "clusterName", "type": "str"}, + "keyspace_name": {"key": "keyspaceName", "type": "str"}, + "column_families": {"key": "columnFamilies", "type": "[str]"}, + "repair_parallelism": {"key": "repairParallelism", "type": "str"}, + "incremental_repair": {"key": "incrementalRepair", "type": "bool"}, + "scheduled_days_between": {"key": "scheduledDaysBetween", "type": "int"}, + "nodes": {"key": "nodes", "type": "[str]"}, + "datacenters": {"key": "datacenters", "type": "[str]"}, + "blacklisted_tables": {"key": "blacklistedTables", "type": "[str]"}, + "segment_count_per_node": {"key": "segmentCountPerNode", "type": "int"}, + "repair_thread_count": {"key": "repairThreadCount", "type": "int"}, + "repair_unit_id": {"key": "repairUnitId", "type": "str"}, + "next_activation": {"key": "nextActivation", "type": "str"}, + "creation_time": {"key": "creationTime", "type": "str"}, + "pause_time": {"key": "pauseTime", "type": "str"}, + "segment_timeout": {"key": "segmentTimeout", "type": "int"}, + "adaptive": {"key": "adaptive", "type": "bool"}, + "percent_unrepaired_threshold": {"key": "percentUnrepairedThreshold", "type": "int"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + owner: Optional[str] = None, + state: Optional[str] = None, + intensity: Optional[float] = None, + cluster_name: Optional[str] = None, + keyspace_name: Optional[str] = None, + column_families: Optional[List[str]] = None, + repair_parallelism: Optional[str] = None, + incremental_repair: Optional[bool] = None, + scheduled_days_between: Optional[int] = None, + nodes: Optional[List[str]] = None, + datacenters: Optional[List[str]] = None, + blacklisted_tables: Optional[List[str]] = None, + segment_count_per_node: Optional[int] = None, + repair_thread_count: Optional[int] = None, + repair_unit_id: Optional[str] = None, + next_activation: Optional[str] = None, + creation_time: Optional[str] = None, + pause_time: Optional[str] = None, + segment_timeout: Optional[int] = None, + adaptive: Optional[bool] = None, + percent_unrepaired_threshold: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: + :paramtype id: str + :keyword owner: + :paramtype owner: str + :keyword state: + :paramtype state: str + :keyword intensity: + :paramtype intensity: float + :keyword cluster_name: + :paramtype cluster_name: str + :keyword keyspace_name: + :paramtype keyspace_name: str + :keyword column_families: + :paramtype column_families: list[str] + :keyword repair_parallelism: + :paramtype repair_parallelism: str + :keyword incremental_repair: + :paramtype incremental_repair: bool + :keyword scheduled_days_between: + :paramtype scheduled_days_between: int + :keyword nodes: + :paramtype nodes: list[str] + :keyword datacenters: + :paramtype datacenters: list[str] + :keyword blacklisted_tables: + :paramtype blacklisted_tables: list[str] + :keyword segment_count_per_node: + :paramtype segment_count_per_node: int + :keyword repair_thread_count: + :paramtype repair_thread_count: int + :keyword repair_unit_id: + :paramtype repair_unit_id: str + :keyword next_activation: + :paramtype next_activation: str + :keyword creation_time: + :paramtype creation_time: str + :keyword pause_time: + :paramtype pause_time: str + :keyword segment_timeout: + :paramtype segment_timeout: int + :keyword adaptive: + :paramtype adaptive: bool + :keyword percent_unrepaired_threshold: + :paramtype percent_unrepaired_threshold: int + """ + super().__init__(**kwargs) + self.id = id + self.owner = owner + self.state = state + self.intensity = intensity + self.cluster_name = cluster_name + self.keyspace_name = keyspace_name + self.column_families = column_families + self.repair_parallelism = repair_parallelism + self.incremental_repair = incremental_repair + self.scheduled_days_between = scheduled_days_between + self.nodes = nodes + self.datacenters = datacenters + self.blacklisted_tables = blacklisted_tables + self.segment_count_per_node = segment_count_per_node + self.repair_thread_count = repair_thread_count + self.repair_unit_id = repair_unit_id + self.next_activation = next_activation + self.creation_time = creation_time + self.pause_time = pause_time + self.segment_timeout = segment_timeout + self.adaptive = adaptive + self.percent_unrepaired_threshold = percent_unrepaired_threshold + + +class CassandraRepairRingRange(_serialization.Model): + """CassandraRepairRingRange. + + :ivar start: + :vartype start: str + :ivar end: + :vartype end: str + """ + + _attribute_map = { + "start": {"key": "start", "type": "str"}, + "end": {"key": "end", "type": "str"}, + } + + def __init__(self, *, start: Optional[str] = None, end: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword start: + :paramtype start: str + :keyword end: + :paramtype end: str + """ + super().__init__(**kwargs) + self.start = start + self.end = end + + +class CassandraRepairSegment(_serialization.Model): + """CassandraRepairSegment. + + :ivar id: + :vartype id: str + :ivar run_id: + :vartype run_id: str + :ivar repair_unit_id: + :vartype repair_unit_id: str + :ivar token_range: + :vartype token_range: ~azure.mgmt.cosmosdb.models.CassandraRepairTokenRange + :ivar fail_count: + :vartype fail_count: int + :ivar state: + :vartype state: str + :ivar coordinator_host: + :vartype coordinator_host: str + :ivar start_time: + :vartype start_time: str + :ivar end_time: + :vartype end_time: str + :ivar replicas: Dictionary of :code:``. + :vartype replicas: dict[str, str] + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "run_id": {"key": "runId", "type": "str"}, + "repair_unit_id": {"key": "repairUnitId", "type": "str"}, + "token_range": {"key": "tokenRange", "type": "CassandraRepairTokenRange"}, + "fail_count": {"key": "failCount", "type": "int"}, + "state": {"key": "state", "type": "str"}, + "coordinator_host": {"key": "coordinatorHost", "type": "str"}, + "start_time": {"key": "startTime", "type": "str"}, + "end_time": {"key": "endTime", "type": "str"}, + "replicas": {"key": "replicas", "type": "{str}"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + run_id: Optional[str] = None, + repair_unit_id: Optional[str] = None, + token_range: Optional["_models.CassandraRepairTokenRange"] = None, + fail_count: Optional[int] = None, + state: Optional[str] = None, + coordinator_host: Optional[str] = None, + start_time: Optional[str] = None, + end_time: Optional[str] = None, + replicas: Optional[Dict[str, str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: + :paramtype id: str + :keyword run_id: + :paramtype run_id: str + :keyword repair_unit_id: + :paramtype repair_unit_id: str + :keyword token_range: + :paramtype token_range: ~azure.mgmt.cosmosdb.models.CassandraRepairTokenRange + :keyword fail_count: + :paramtype fail_count: int + :keyword state: + :paramtype state: str + :keyword coordinator_host: + :paramtype coordinator_host: str + :keyword start_time: + :paramtype start_time: str + :keyword end_time: + :paramtype end_time: str + :keyword replicas: Dictionary of :code:``. + :paramtype replicas: dict[str, str] + """ + super().__init__(**kwargs) + self.id = id + self.run_id = run_id + self.repair_unit_id = repair_unit_id + self.token_range = token_range + self.fail_count = fail_count + self.state = state + self.coordinator_host = coordinator_host + self.start_time = start_time + self.end_time = end_time + self.replicas = replicas + + +class CassandraRepairSegmentResourceFeedResponse(_serialization.Model): + """CassandraRepairSegmentResourceFeedResponse. + + :ivar value: + :vartype value: list[~azure.mgmt.cosmosdb.models.CassandraRepairSegment] + """ + + _attribute_map = { + "value": {"key": "value", "type": "[CassandraRepairSegment]"}, + } + + def __init__(self, *, value: Optional[List["_models.CassandraRepairSegment"]] = None, **kwargs: Any) -> None: + """ + :keyword value: + :paramtype value: list[~azure.mgmt.cosmosdb.models.CassandraRepairSegment] + """ + super().__init__(**kwargs) + self.value = value + + +class CassandraRepairTokenRange(_serialization.Model): + """CassandraRepairTokenRange. + + :ivar base_range: + :vartype base_range: ~azure.mgmt.cosmosdb.models.CassandraRepairRingRange + :ivar token_ranges: + :vartype token_ranges: list[~azure.mgmt.cosmosdb.models.CassandraRepairRingRange] + :ivar replicas: Dictionary of :code:``. + :vartype replicas: dict[str, str] + """ + + _attribute_map = { + "base_range": {"key": "baseRange", "type": "CassandraRepairRingRange"}, + "token_ranges": {"key": "tokenRanges", "type": "[CassandraRepairRingRange]"}, + "replicas": {"key": "replicas", "type": "{str}"}, + } + + def __init__( + self, + *, + base_range: Optional["_models.CassandraRepairRingRange"] = None, + token_ranges: Optional[List["_models.CassandraRepairRingRange"]] = None, + replicas: Optional[Dict[str, str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword base_range: + :paramtype base_range: ~azure.mgmt.cosmosdb.models.CassandraRepairRingRange + :keyword token_ranges: + :paramtype token_ranges: list[~azure.mgmt.cosmosdb.models.CassandraRepairRingRange] + :keyword replicas: Dictionary of :code:``. + :paramtype replicas: dict[str, str] + """ + super().__init__(**kwargs) + self.base_range = base_range + self.token_ranges = token_ranges + self.replicas = replicas + + class CassandraSchema(_serialization.Model): """Cosmos DB Cassandra table schema. @@ -1268,8 +2074,8 @@ def __init__( columns: Optional[List["_models.Column"]] = None, partition_keys: Optional[List["_models.CassandraPartitionKey"]] = None, cluster_keys: Optional[List["_models.ClusterKey"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword columns: List of Cassandra table columns. :paramtype columns: list[~azure.mgmt.cosmosdb.models.Column] @@ -1341,8 +2147,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -1386,8 +2192,8 @@ def __init__( *, throughput: Optional[int] = None, autoscale_settings: Optional["_models.AutoscaleSettings"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. @@ -1431,8 +2237,8 @@ def __init__( default_ttl: Optional[int] = None, schema: Optional["_models.CassandraSchema"] = None, analytical_storage_ttl: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: Name of the Cosmos DB Cassandra table. Required. :paramtype id: str @@ -1498,8 +2304,8 @@ def __init__( default_ttl: Optional[int] = None, schema: Optional["_models.CassandraSchema"] = None, analytical_storage_ttl: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: Name of the Cosmos DB Cassandra table. Required. :paramtype id: str @@ -1575,8 +2381,8 @@ def __init__( identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.CassandraTableGetPropertiesResource"] = None, options: Optional["_models.CassandraTableGetPropertiesOptions"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -1616,7 +2422,7 @@ class CassandraTableListResult(_serialization.Model): "value": {"key": "value", "type": "[CassandraTableGetResults]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -1679,8 +2485,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -1724,8 +2530,8 @@ def __init__( *, throughput: Optional[int] = None, autoscale_settings: Optional["_models.AutoscaleSettings"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. @@ -1757,7 +2563,7 @@ class CassandraViewResource(_serialization.Model): "view_definition": {"key": "viewDefinition", "type": "str"}, } - def __init__(self, *, id: str, view_definition: str, **kwargs): # pylint: disable=redefined-builtin + def __init__(self, *, id: str, view_definition: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin """ :keyword id: Name of the Cosmos DB Cassandra view. Required. :paramtype id: str @@ -1805,7 +2611,7 @@ class CassandraViewGetPropertiesResource(CassandraViewResource, ExtendedResource "view_definition": {"key": "viewDefinition", "type": "str"}, } - def __init__(self, *, id: str, view_definition: str, **kwargs): # pylint: disable=redefined-builtin + def __init__(self, *, id: str, view_definition: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin """ :keyword id: Name of the Cosmos DB Cassandra view. Required. :paramtype id: str @@ -1873,8 +2679,8 @@ def __init__( identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.CassandraViewGetPropertiesResource"] = None, options: Optional["_models.CassandraViewGetPropertiesOptions"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -1914,7 +2720,7 @@ class CassandraViewListResult(_serialization.Model): "value": {"key": "value", "type": "[CassandraViewGetResults]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -1931,7 +2737,7 @@ class Certificate(_serialization.Model): "pem": {"key": "pem", "type": "str"}, } - def __init__(self, *, pem: Optional[str] = None, **kwargs): + def __init__(self, *, pem: Optional[str] = None, **kwargs: Any) -> None: """ :keyword pem: PEM formatted public key. :paramtype pem: str @@ -1973,8 +2779,14 @@ class ClientEncryptionIncludedPath(_serialization.Model): } def __init__( - self, *, path: str, client_encryption_key_id: str, encryption_type: str, encryption_algorithm: str, **kwargs - ): + 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 @@ -2012,7 +2824,7 @@ class ClientEncryptionKeyCreateUpdateParameters(_serialization.Model): "resource": {"key": "properties.resource", "type": "ClientEncryptionKeyResource"}, } - def __init__(self, *, resource: "_models.ClientEncryptionKeyResource", **kwargs): + 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 @@ -2051,8 +2863,8 @@ def __init__( encryption_algorithm: Optional[str] = None, wrapped_data_encryption_key: Optional[bytes] = None, key_wrap_metadata: Optional["_models.KeyWrapMetadata"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: Name of the ClientEncryptionKey. :paramtype id: str @@ -2121,8 +2933,8 @@ def __init__( encryption_algorithm: Optional[str] = None, wrapped_data_encryption_key: Optional[bytes] = None, key_wrap_metadata: Optional["_models.KeyWrapMetadata"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: Name of the ClientEncryptionKey. :paramtype id: str @@ -2180,7 +2992,9 @@ class ClientEncryptionKeyGetResults(ARMProxyResource): "resource": {"key": "properties.resource", "type": "ClientEncryptionKeyGetPropertiesResource"}, } - def __init__(self, *, resource: Optional["_models.ClientEncryptionKeyGetPropertiesResource"] = None, **kwargs): + def __init__( + self, *, resource: Optional["_models.ClientEncryptionKeyGetPropertiesResource"] = None, **kwargs: Any + ) -> None: """ :keyword resource: :paramtype resource: ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetPropertiesResource @@ -2206,7 +3020,7 @@ class ClientEncryptionKeysListResult(_serialization.Model): "value": {"key": "value", "type": "[ClientEncryptionKeyGetResults]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -2235,8 +3049,12 @@ class ClientEncryptionPolicy(_serialization.Model): } def __init__( - self, *, included_paths: List["_models.ClientEncryptionIncludedPath"], policy_format_version: int = 1, **kwargs - ): + self, + *, + included_paths: List["_models.ClientEncryptionIncludedPath"], + policy_format_version: int = 1, + **kwargs: Any + ) -> None: """ :keyword included_paths: Paths of the item that need encryption along with path-specific settings. Required. @@ -2265,7 +3083,7 @@ class ClusterKey(_serialization.Model): "order_by": {"key": "orderBy", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, order_by: Optional[str] = None, **kwargs): + 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 @@ -2323,8 +3141,8 @@ def __init__( location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedCassandraManagedServiceIdentity"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -2396,8 +3214,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedCassandraManagedServiceIdentity"] = None, properties: Optional["_models.ClusterResourceProperties"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -2444,8 +3262,8 @@ class ClusterResourceProperties(_serialization.Model): # pylint: disable=too-ma :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'. 'Ldap' is - in preview. Known values are: "None", "Cassandra", and "Ldap". + 'Cassandra' is the default password based authentication. The default is 'Cassandra'. Known + values are: "None" and "Cassandra". :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 @@ -2478,7 +3296,8 @@ class ClusterResourceProperties(_serialization.Model): # pylint: disable=too-ma :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: Number of hours to wait between taking a backup of the cluster. + :ivar hours_between_backups: Number of hours to wait between taking a backup of the cluster. To + disable backups, set this property to 0. :vartype hours_between_backups: int :ivar deallocated: Whether the cluster and associated data centers has been deallocated. :vartype deallocated: bool @@ -2529,8 +3348,8 @@ def __init__( hours_between_backups: Optional[int] = None, deallocated: Optional[bool] = None, cassandra_audit_logging_enabled: Optional[bool] = None, - **kwargs - ): + **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". @@ -2555,7 +3374,7 @@ def __init__( :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'. 'Ldap' is in preview. Known values are: "None", "Cassandra", and "Ldap". + 'Cassandra'. Known values are: "None" and "Cassandra". :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 @@ -2582,6 +3401,7 @@ def __init__( 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: Number of hours to wait between taking a backup of the cluster. + To disable backups, set this property to 0. :paramtype hours_between_backups: int :keyword deallocated: Whether the cluster and associated data centers has been deallocated. :paramtype deallocated: bool @@ -2622,7 +3442,7 @@ class Column(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, type: Optional[str] = None, **kwargs): + 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 @@ -2645,7 +3465,7 @@ class CommandOutput(_serialization.Model): "command_output": {"key": "commandOutput", "type": "str"}, } - def __init__(self, *, command_output: Optional[str] = None, **kwargs): + def __init__(self, *, command_output: Optional[str] = None, **kwargs: Any) -> None: """ :keyword command_output: Output of the command. :paramtype command_output: str @@ -2694,8 +3514,8 @@ def __init__( arguments: Optional[Dict[str, str]] = None, cassandra_stop_start: Optional[bool] = None, readwrite: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword command: The command which should be run. Required. :paramtype command: str @@ -2738,8 +3558,8 @@ def __init__( *, path: Optional[str] = None, order: Optional[Union[str, "_models.CompositePathSortOrder"]] = None, - **kwargs - ): + **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/*). @@ -2775,11 +3595,11 @@ class ConflictResolutionPolicy(_serialization.Model): def __init__( self, *, - mode: Union[str, "_models.ConflictResolutionMode"] = "LastWriterWins", + mode: Optional[Union[str, "_models.ConflictResolutionMode"]] = None, conflict_resolution_path: Optional[str] = None, conflict_resolution_procedure: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword mode: Indicates the conflict resolution mode. Known values are: "LastWriterWins" and "Custom". @@ -2830,8 +3650,8 @@ def __init__( i_p_to: Optional[str] = None, port: Optional[int] = None, exception: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword connection_state: The kind of connection error that occurred. Known values are: "Unknown", "OK", "OperatorToDataCenterNetworkError", "DatacenterToDatacenterNetworkError", @@ -2891,8 +3711,8 @@ def __init__( default_consistency_level: Union[str, "_models.DefaultConsistencyLevel"], max_staleness_prefix: Optional[int] = None, max_interval_in_seconds: Optional[int] = None, - **kwargs - ): + **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", @@ -2915,7 +3735,8 @@ def __init__( class ContainerPartitionKey(_serialization.Model): - """The configuration of the partition key to be used for partitioning data into multiple partitions. + """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. @@ -2947,10 +3768,10 @@ def __init__( self, *, paths: Optional[List[str]] = None, - kind: Union[str, "_models.PartitionKind"] = "Hash", + kind: Optional[Union[str, "_models.PartitionKind"]] = None, version: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword paths: List of paths using which data within the container can be partitioned. :paramtype paths: list[str] @@ -2979,7 +3800,7 @@ class ContinuousBackupInformation(_serialization.Model): "latest_restorable_timestamp": {"key": "latestRestorableTimestamp", "type": "str"}, } - def __init__(self, *, latest_restorable_timestamp: Optional[str] = None, **kwargs): + 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 @@ -2999,7 +3820,7 @@ class ContinuousBackupRestoreLocation(_serialization.Model): "location": {"key": "location", "type": "str"}, } - def __init__(self, *, location: Optional[str] = None, **kwargs): + def __init__(self, *, location: Optional[str] = None, **kwargs: Any) -> None: """ :keyword location: The name of the continuous backup restore location. :paramtype location: str @@ -3038,8 +3859,8 @@ def __init__( *, migration_state: Optional["_models.BackupPolicyMigrationState"] = None, continuous_mode_properties: Optional["_models.ContinuousModeProperties"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword migration_state: The object representing the state of the migration between the backup policies. @@ -3048,7 +3869,7 @@ def __init__( :paramtype continuous_mode_properties: ~azure.mgmt.cosmosdb.models.ContinuousModeProperties """ super().__init__(migration_state=migration_state, **kwargs) - self.type = "Continuous" # type: str + self.type: str = "Continuous" self.continuous_mode_properties = continuous_mode_properties @@ -3064,7 +3885,7 @@ class ContinuousModeProperties(_serialization.Model): "tier": {"key": "tier", "type": "str"}, } - def __init__(self, *, tier: Optional[Union[str, "_models.ContinuousTier"]] = None, **kwargs): + 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". @@ -3117,8 +3938,8 @@ def __init__( allowed_headers: Optional[str] = None, exposed_headers: Optional[str] = None, max_age_in_seconds: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword allowed_origins: The origin domains that are permitted to make a request against the service via CORS. Required. @@ -3170,7 +3991,7 @@ class CosmosCassandraDataTransferDataSourceSink(DataTransferDataSourceSink): "table_name": {"key": "tableName", "type": "str"}, } - def __init__(self, *, keyspace_name: str, table_name: str, **kwargs): + def __init__(self, *, keyspace_name: str, table_name: str, **kwargs: Any) -> None: """ :keyword keyspace_name: Required. :paramtype keyspace_name: str @@ -3178,7 +3999,7 @@ def __init__(self, *, keyspace_name: str, table_name: str, **kwargs): :paramtype table_name: str """ super().__init__(**kwargs) - self.component = "CosmosDBCassandra" # type: str + self.component: str = "CosmosDBCassandra" self.keyspace_name = keyspace_name self.table_name = table_name @@ -3209,7 +4030,7 @@ class CosmosMongoDataTransferDataSourceSink(DataTransferDataSourceSink): "collection_name": {"key": "collectionName", "type": "str"}, } - def __init__(self, *, database_name: str, collection_name: str, **kwargs): + def __init__(self, *, database_name: str, collection_name: str, **kwargs: Any) -> None: """ :keyword database_name: Required. :paramtype database_name: str @@ -3217,7 +4038,7 @@ def __init__(self, *, database_name: str, collection_name: str, **kwargs): :paramtype collection_name: str """ super().__init__(**kwargs) - self.component = "CosmosDBMongo" # type: str + self.component: str = "CosmosDBMongo" self.database_name = database_name self.collection_name = collection_name @@ -3248,7 +4069,7 @@ class CosmosSqlDataTransferDataSourceSink(DataTransferDataSourceSink): "container_name": {"key": "containerName", "type": "str"}, } - def __init__(self, *, database_name: str, container_name: str, **kwargs): + def __init__(self, *, database_name: str, container_name: str, **kwargs: Any) -> None: """ :keyword database_name: Required. :paramtype database_name: str @@ -3256,7 +4077,7 @@ def __init__(self, *, database_name: str, container_name: str, **kwargs): :paramtype container_name: str """ super().__init__(**kwargs) - self.component = "CosmosDBSql" # type: str + self.component: str = "CosmosDBSql" self.database_name = database_name self.container_name = container_name @@ -3292,7 +4113,7 @@ class CreateJobRequest(ARMProxyResource): "properties": {"key": "properties", "type": "DataTransferJobProperties"}, } - def __init__(self, *, properties: "_models.DataTransferJobProperties", **kwargs): + def __init__(self, *, properties: "_models.DataTransferJobProperties", **kwargs: Any) -> None: """ :keyword properties: Data Transfer Create Job Properties. Required. :paramtype properties: ~azure.mgmt.cosmosdb.models.DataTransferJobProperties @@ -3302,7 +4123,8 @@ def __init__(self, *, properties: "_models.DataTransferJobProperties", **kwargs) 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". + """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 @@ -3320,8 +4142,8 @@ def __init__( *, throughput: Optional[int] = None, autoscale_settings: Optional["_models.AutoscaleSettings"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword throughput: Request Units per second. For example, "throughput": 10000. :paramtype throughput: int @@ -3354,7 +4176,7 @@ class DatabaseAccountConnectionString(_serialization.Model): "description": {"key": "description", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.connection_string = None @@ -3558,7 +4380,7 @@ def __init__( # pylint: disable=too-many-locals 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", + create_mode: Optional[Union[str, "_models.CreateMode"]] = None, backup_policy: Optional["_models.BackupPolicy"] = None, cors: Optional[List["_models.CorsPolicy"]] = None, network_acl_bypass: Optional[Union[str, "_models.NetworkAclBypass"]] = None, @@ -3569,8 +4391,8 @@ def __init__( # pylint: disable=too-many-locals capacity: Optional["_models.Capacity"] = None, enable_materialized_views: Optional[bool] = None, enable_partition_merge: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -3935,7 +4757,7 @@ def __init__( # pylint: disable=too-many-locals 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", + create_mode: Optional[Union[str, "_models.CreateMode"]] = None, restore_parameters: Optional["_models.RestoreParameters"] = None, backup_policy: Optional["_models.BackupPolicy"] = None, cors: Optional[List["_models.CorsPolicy"]] = None, @@ -3946,8 +4768,8 @@ def __init__( # pylint: disable=too-many-locals capacity: Optional["_models.Capacity"] = None, enable_materialized_views: Optional[bool] = None, enable_partition_merge: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -4116,7 +4938,7 @@ class DatabaseAccountKeysMetadata(_serialization.Model): "secondary_readonly_master_key": {"key": "secondaryReadonlyMasterKey", "type": "AccountKeyMetadata"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.primary_master_key = None @@ -4138,8 +4960,8 @@ class DatabaseAccountListConnectionStringsResult(_serialization.Model): } def __init__( - self, *, connection_strings: Optional[List["_models.DatabaseAccountConnectionString"]] = None, **kwargs - ): + 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. @@ -4171,7 +4993,7 @@ class DatabaseAccountListReadOnlyKeysResult(_serialization.Model): "secondary_readonly_master_key": {"key": "secondaryReadonlyMasterKey", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.primary_readonly_master_key = None @@ -4207,7 +5029,7 @@ class DatabaseAccountListKeysResult(DatabaseAccountListReadOnlyKeysResult): "secondary_master_key": {"key": "secondaryMasterKey", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.primary_master_key = None @@ -4232,7 +5054,7 @@ class DatabaseAccountRegenerateKeyParameters(_serialization.Model): "key_kind": {"key": "keyKind", "type": "str"}, } - def __init__(self, *, key_kind: Union[str, "_models.KeyKind"], **kwargs): + 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". @@ -4259,7 +5081,7 @@ class DatabaseAccountsListResult(_serialization.Model): "value": {"key": "value", "type": "[DatabaseAccountGetResults]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -4436,8 +5258,8 @@ def __init__( # pylint: disable=too-many-locals capacity: Optional["_models.Capacity"] = None, enable_materialized_views: Optional[bool] = None, enable_partition_merge: Optional[bool] = None, - **kwargs - ): + **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 @@ -4573,7 +5395,9 @@ class DatabaseRestoreResource(_serialization.Model): "collection_names": {"key": "collectionNames", "type": "[str]"}, } - def __init__(self, *, database_name: Optional[str] = None, collection_names: Optional[List[str]] = None, **kwargs): + 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 @@ -4613,7 +5437,7 @@ class DataCenterResource(ARMProxyResource): "properties": {"key": "properties", "type": "DataCenterResourceProperties"}, } - def __init__(self, *, properties: Optional["_models.DataCenterResourceProperties"] = None, **kwargs): + 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 @@ -4666,13 +5490,9 @@ class DataCenterResourceProperties(_serialization.Model): # pylint: disable=too :vartype disk_sku: str :ivar disk_capacity: Number of disk used for data centers. Default value is 4. :vartype disk_capacity: int - :ivar availability_zone: If the data center has Availability Zone feature, apply it to the - Virtual Machine ScaleSet that host the cassandra data center virtual machines. + :ivar availability_zone: If the azure 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 """ _validation = { @@ -4692,10 +5512,6 @@ class DataCenterResourceProperties(_serialization.Model): # pylint: disable=too "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", - }, } def __init__( @@ -4712,9 +5528,8 @@ def __init__( disk_sku: Optional[str] = None, disk_capacity: Optional[int] = None, availability_zone: Optional[bool] = None, - authentication_method_ldap_properties: Optional["_models.AuthenticationMethodLdapProperties"] = None, - **kwargs - ): + **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". @@ -4751,13 +5566,9 @@ def __init__( :paramtype disk_sku: str :keyword disk_capacity: Number of disk used for data centers. Default value is 4. :paramtype disk_capacity: int - :keyword availability_zone: If the data center has Availability Zone feature, apply it to the - Virtual Machine ScaleSet that host the cassandra data center virtual machines. + :keyword availability_zone: If the azure 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 """ super().__init__(**kwargs) self.provisioning_state = provisioning_state @@ -4772,7 +5583,6 @@ def __init__( self.disk_sku = disk_sku self.disk_capacity = disk_capacity self.availability_zone = availability_zone - self.authentication_method_ldap_properties = authentication_method_ldap_properties class DataTransferJobFeedResults(_serialization.Model): @@ -4796,7 +5606,7 @@ class DataTransferJobFeedResults(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -4868,8 +5678,8 @@ def __init__( source: Optional["_models.DataTransferDataSourceSink"] = None, destination: Optional["_models.DataTransferDataSourceSink"] = None, worker_count: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword source: Source DataStore details. :paramtype source: ~azure.mgmt.cosmosdb.models.DataTransferDataSourceSink @@ -4947,8 +5757,8 @@ def __init__( source: "_models.DataTransferDataSourceSink", destination: "_models.DataTransferDataSourceSink", worker_count: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword source: Source DataStore details. Required. :paramtype source: ~azure.mgmt.cosmosdb.models.DataTransferDataSourceSink @@ -4995,7 +5805,7 @@ class RegionalServiceResource(_serialization.Model): "status": {"key": "status", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.name = None @@ -5029,7 +5839,7 @@ class DataTransferRegionalServiceResource(RegionalServiceResource): "status": {"key": "status", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) @@ -5045,7 +5855,9 @@ class DataTransferServiceResource(_serialization.Model): "properties": {"key": "properties", "type": "DataTransferServiceResourceProperties"}, } - def __init__(self, *, properties: Optional["_models.DataTransferServiceResourceProperties"] = None, **kwargs): + def __init__( + self, *, properties: Optional["_models.DataTransferServiceResourceProperties"] = None, **kwargs: Any + ) -> None: """ :keyword properties: Properties for DataTransferServiceResource. :paramtype properties: ~azure.mgmt.cosmosdb.models.DataTransferServiceResourceProperties @@ -5114,8 +5926,8 @@ def __init__( additional_properties: Optional[Dict[str, JSON]] = None, instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, instance_count: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. @@ -5131,7 +5943,7 @@ def __init__( self.creation_time = None self.instance_size = instance_size self.instance_count = instance_count - self.service_type = None # type: Optional[str] + self.service_type: Optional[str] = None self.status = None @@ -5186,8 +5998,8 @@ def __init__( additional_properties: Optional[Dict[str, JSON]] = None, instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, instance_count: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. @@ -5204,7 +6016,7 @@ def __init__( instance_count=instance_count, **kwargs ) - self.service_type = "DataTransfer" # type: str + self.service_type: str = "DataTransfer" self.locations = None @@ -5220,7 +6032,9 @@ class DiagnosticLogSettings(_serialization.Model): "enable_full_text_query": {"key": "enableFullTextQuery", "type": "str"}, } - def __init__(self, *, enable_full_text_query: Optional[Union[str, "_models.EnableFullTextQuery"]] = None, **kwargs): + def __init__( + self, *, enable_full_text_query: Optional[Union[str, "_models.EnableFullTextQuery"]] = 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". @@ -5244,7 +6058,7 @@ class ErrorResponse(_serialization.Model): "message": {"key": "message", "type": "str"}, } - def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None, **kwargs): + def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None, **kwargs: Any) -> None: """ :keyword code: Error code. :paramtype code: str @@ -5268,7 +6082,7 @@ class ExcludedPath(_serialization.Model): "path": {"key": "path", "type": "str"}, } - def __init__(self, *, path: Optional[str] = None, **kwargs): + 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/*). @@ -5295,7 +6109,7 @@ class FailoverPolicies(_serialization.Model): "failover_policies": {"key": "failoverPolicies", "type": "[FailoverPolicy]"}, } - def __init__(self, *, failover_policies: List["_models.FailoverPolicy"], **kwargs): + 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] @@ -5332,7 +6146,9 @@ class FailoverPolicy(_serialization.Model): "failover_priority": {"key": "failoverPriority", "type": "int"}, } - def __init__(self, *, location_name: Optional[str] = None, failover_priority: Optional[int] = None, **kwargs): + def __init__( + self, *, location_name: Optional[str] = None, failover_priority: Optional[int] = None, **kwargs: Any + ) -> None: """ :keyword location_name: The name of the region in which the database account exists. :paramtype location_name: str @@ -5378,7 +6194,7 @@ class GraphAPIComputeRegionalServiceResource(RegionalServiceResource): "graph_api_compute_endpoint": {"key": "graphApiComputeEndpoint", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.graph_api_compute_endpoint = None @@ -5395,7 +6211,9 @@ class GraphAPIComputeServiceResource(_serialization.Model): "properties": {"key": "properties", "type": "GraphAPIComputeServiceResourceProperties"}, } - def __init__(self, *, properties: Optional["_models.GraphAPIComputeServiceResourceProperties"] = None, **kwargs): + def __init__( + self, *, properties: Optional["_models.GraphAPIComputeServiceResourceProperties"] = None, **kwargs: Any + ) -> None: """ :keyword properties: Properties for GraphAPIComputeServiceResource. :paramtype properties: ~azure.mgmt.cosmosdb.models.GraphAPIComputeServiceResourceProperties @@ -5459,8 +6277,8 @@ def __init__( instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, instance_count: Optional[int] = None, graph_api_compute_endpoint: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. @@ -5479,7 +6297,7 @@ def __init__( instance_count=instance_count, **kwargs ) - self.service_type = "GraphAPICompute" # type: str + self.service_type: str = "GraphAPICompute" self.graph_api_compute_endpoint = graph_api_compute_endpoint self.locations = None @@ -5501,7 +6319,7 @@ class GraphResource(_serialization.Model): "id": {"key": "id", "type": "str"}, } - def __init__(self, *, id: str, **kwargs): # pylint: disable=redefined-builtin + def __init__(self, *, id: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin """ :keyword id: Name of the Cosmos DB Graph. Required. :paramtype id: str @@ -5567,8 +6385,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -5612,8 +6430,8 @@ def __init__( *, throughput: Optional[int] = None, autoscale_settings: Optional["_models.AutoscaleSettings"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. @@ -5641,7 +6459,7 @@ class GraphResourceGetPropertiesResource(GraphResource): "id": {"key": "id", "type": "str"}, } - def __init__(self, *, id: str, **kwargs): # pylint: disable=redefined-builtin + def __init__(self, *, id: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin """ :keyword id: Name of the Cosmos DB Graph. Required. :paramtype id: str @@ -5702,8 +6520,8 @@ def __init__( identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.GraphResourceGetPropertiesResource"] = None, options: Optional["_models.GraphResourceGetPropertiesOptions"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -5743,7 +6561,7 @@ class GraphResourcesListResult(_serialization.Model): "value": {"key": "value", "type": "[GraphResourceGetResults]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -5806,8 +6624,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -5851,8 +6669,8 @@ def __init__( *, throughput: Optional[int] = None, autoscale_settings: Optional["_models.AutoscaleSettings"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. @@ -5880,7 +6698,7 @@ class GremlinDatabaseResource(_serialization.Model): "id": {"key": "id", "type": "str"}, } - def __init__(self, *, id: str, **kwargs): # pylint: disable=redefined-builtin + def __init__(self, *, id: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin """ :keyword id: Name of the Cosmos DB Gremlin database. Required. :paramtype id: str @@ -5921,7 +6739,7 @@ class GremlinDatabaseGetPropertiesResource(GremlinDatabaseResource, ExtendedReso "id": {"key": "id", "type": "str"}, } - def __init__(self, *, id: str, **kwargs): # pylint: disable=redefined-builtin + def __init__(self, *, id: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin """ :keyword id: Name of the Cosmos DB Gremlin database. Required. :paramtype id: str @@ -5986,8 +6804,8 @@ def __init__( identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.GremlinDatabaseGetPropertiesResource"] = None, options: Optional["_models.GremlinDatabaseGetPropertiesOptions"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -6027,7 +6845,7 @@ class GremlinDatabaseListResult(_serialization.Model): "value": {"key": "value", "type": "[GremlinDatabaseGetResults]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -6047,7 +6865,9 @@ class GremlinDatabaseRestoreResource(_serialization.Model): "graph_names": {"key": "graphNames", "type": "[str]"}, } - def __init__(self, *, database_name: Optional[str] = None, graph_names: Optional[List[str]] = None, **kwargs): + def __init__( + self, *, database_name: Optional[str] = None, graph_names: Optional[List[str]] = None, **kwargs: Any + ) -> None: """ :keyword database_name: The name of the gremlin database available for restore. :paramtype database_name: str @@ -6116,8 +6936,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -6161,8 +6981,8 @@ def __init__( *, throughput: Optional[int] = None, autoscale_settings: Optional["_models.AutoscaleSettings"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. @@ -6221,8 +7041,8 @@ def __init__( unique_key_policy: Optional["_models.UniqueKeyPolicy"] = None, conflict_resolution_policy: Optional["_models.ConflictResolutionPolicy"] = None, analytical_storage_ttl: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: Name of the Cosmos DB Gremlin graph. Required. :paramtype id: str @@ -6315,8 +7135,8 @@ def __init__( unique_key_policy: Optional["_models.UniqueKeyPolicy"] = None, conflict_resolution_policy: Optional["_models.ConflictResolutionPolicy"] = None, analytical_storage_ttl: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: Name of the Cosmos DB Gremlin graph. Required. :paramtype id: str @@ -6411,8 +7231,8 @@ def __init__( identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.GremlinGraphGetPropertiesResource"] = None, options: Optional["_models.GremlinGraphGetPropertiesOptions"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -6452,7 +7272,7 @@ class GremlinGraphListResult(_serialization.Model): "value": {"key": "value", "type": "[GremlinGraphGetResults]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -6473,7 +7293,9 @@ class IncludedPath(_serialization.Model): "indexes": {"key": "indexes", "type": "[Indexes]"}, } - def __init__(self, *, path: Optional[str] = None, indexes: Optional[List["_models.Indexes"]] = None, **kwargs): + 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/*). @@ -6507,11 +7329,11 @@ class Indexes(_serialization.Model): def __init__( self, *, - data_type: Union[str, "_models.DataType"] = "String", + data_type: Optional[Union[str, "_models.DataType"]] = None, precision: Optional[int] = None, - kind: Union[str, "_models.IndexKind"] = "Hash", - **kwargs - ): + kind: Optional[Union[str, "_models.IndexKind"]] = 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". @@ -6558,13 +7380,13 @@ def __init__( self, *, automatic: Optional[bool] = None, - indexing_mode: Union[str, "_models.IndexingMode"] = "consistent", + indexing_mode: Optional[Union[str, "_models.IndexingMode"]] = None, 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, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword automatic: Indicates if the indexing policy is automatic. :paramtype automatic: bool @@ -6603,7 +7425,7 @@ class IpAddressOrRange(_serialization.Model): "ip_address_or_range": {"key": "ipAddressOrRange", "type": "str"}, } - def __init__(self, *, ip_address_or_range: Optional[str] = None, **kwargs): + 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 @@ -6617,7 +7439,8 @@ def __init__(self, *, ip_address_or_range: Optional[str] = None, **kwargs): class KeyWrapMetadata(_serialization.Model): - """Represents key wrap metadata that a key wrapping provider can use to wrap/unwrap a client encryption key. + """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 @@ -6643,8 +7466,8 @@ def __init__( type: Optional[str] = None, value: Optional[str] = None, algorithm: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: The name of associated KeyEncryptionKey (aka CustomerManagedKey). :paramtype name: str @@ -6662,29 +7485,6 @@ def __init__( self.algorithm = algorithm -class ListBackups(_serialization.Model): - """List of restorable backups for a Cassandra cluster. - - 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] - """ - - _validation = { - "value": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[BackupResource]"}, - } - - def __init__(self, **kwargs): - """ """ - super().__init__(**kwargs) - self.value = None - - class ListClusters(_serialization.Model): """List of managed Cassandra clusters. @@ -6696,7 +7496,7 @@ class ListClusters(_serialization.Model): "value": {"key": "value", "type": "[ClusterResource]"}, } - def __init__(self, *, value: Optional[List["_models.ClusterResource"]] = None, **kwargs): + 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] @@ -6722,7 +7522,7 @@ class ListDataCenters(_serialization.Model): "value": {"key": "value", "type": "[DataCenterResource]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -6781,8 +7581,8 @@ def __init__( location_name: Optional[str] = None, failover_priority: Optional[int] = None, is_zone_redundant: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location_name: The name of the region. :paramtype location_name: str @@ -6832,7 +7632,7 @@ class LocationGetResult(ARMProxyResource): "properties": {"key": "properties", "type": "LocationProperties"}, } - def __init__(self, *, properties: Optional["_models.LocationProperties"] = None, **kwargs): + def __init__(self, *, properties: Optional["_models.LocationProperties"] = None, **kwargs: Any) -> None: """ :keyword properties: Cosmos DB location metadata. :paramtype properties: ~azure.mgmt.cosmosdb.models.LocationProperties @@ -6858,7 +7658,7 @@ class LocationListResult(_serialization.Model): "value": {"key": "value", "type": "[LocationGetResult]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -6895,7 +7695,7 @@ class LocationProperties(_serialization.Model): "backup_storage_redundancies": {"key": "backupStorageRedundancies", "type": "[str]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.status = None @@ -6928,7 +7728,9 @@ class ManagedCassandraManagedServiceIdentity(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, type: Optional[Union[str, "_models.ManagedCassandraResourceIdentityType"]] = None, **kwargs): + def __init__( + self, *, type: Optional[Union[str, "_models.ManagedCassandraResourceIdentityType"]] = 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 @@ -6962,8 +7764,8 @@ def __init__( healthy: Optional[bool] = None, repair_run_ids: Optional[Dict[str, str]] = None, repair_schedules: Optional[Dict[str, str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword healthy: :paramtype healthy: bool @@ -7021,8 +7823,8 @@ def __init__( *, type: Optional[Union[str, "_models.ResourceIdentityType"]] = None, user_assigned_identities: Optional[Dict[str, "_models.ManagedServiceIdentityUserAssignedIdentity"]] = None, - **kwargs - ): + **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 @@ -7063,7 +7865,7 @@ class ManagedServiceIdentityUserAssignedIdentity(_serialization.Model): "client_id": {"key": "clientId", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.principal_id = None @@ -7096,7 +7898,7 @@ class MaterializedViewsBuilderRegionalServiceResource(RegionalServiceResource): "status": {"key": "status", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) @@ -7114,8 +7916,8 @@ class MaterializedViewsBuilderServiceResource(_serialization.Model): } def __init__( - self, *, properties: Optional["_models.MaterializedViewsBuilderServiceResourceProperties"] = None, **kwargs - ): + self, *, properties: Optional["_models.MaterializedViewsBuilderServiceResourceProperties"] = None, **kwargs: Any + ) -> None: """ :keyword properties: Properties for MaterializedViewsBuilderServiceResource. :paramtype properties: @@ -7177,8 +7979,8 @@ def __init__( additional_properties: Optional[Dict[str, JSON]] = None, instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, instance_count: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. @@ -7195,7 +7997,7 @@ def __init__( instance_count=instance_count, **kwargs ) - self.service_type = "MaterializedViewsBuilder" # type: str + self.service_type: str = "MaterializedViewsBuilder" self.locations = None @@ -7210,7 +8012,7 @@ class MergeParameters(_serialization.Model): "is_dry_run": {"key": "isDryRun", "type": "bool"}, } - def __init__(self, *, is_dry_run: Optional[bool] = None, **kwargs): + 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 @@ -7257,7 +8059,7 @@ class Metric(_serialization.Model): "metric_values": {"key": "metricValues", "type": "[MetricValue]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.start_time = None @@ -7289,7 +8091,7 @@ class MetricAvailability(_serialization.Model): "retention": {"key": "retention", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.time_grain = None @@ -7331,7 +8133,7 @@ class MetricDefinition(_serialization.Model): "name": {"key": "name", "type": "MetricName"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.metric_availabilities = None @@ -7358,7 +8160,7 @@ class MetricDefinitionsListResult(_serialization.Model): "value": {"key": "value", "type": "[MetricDefinition]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -7381,7 +8183,7 @@ class MetricListResult(_serialization.Model): "value": {"key": "value", "type": "[Metric]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -7408,7 +8210,7 @@ class MetricName(_serialization.Model): "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -7452,7 +8254,7 @@ class MetricValue(_serialization.Model): "total": {"key": "total", "type": "float"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.count = None @@ -7520,8 +8322,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -7565,8 +8367,8 @@ def __init__( *, throughput: Optional[int] = None, autoscale_settings: Optional["_models.AutoscaleSettings"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. @@ -7618,9 +8420,9 @@ def __init__( 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 - ): + create_mode: Optional[Union[str, "_models.CreateMode"]] = None, + **kwargs: Any + ) -> None: """ :keyword id: Name of the Cosmos DB MongoDB collection. Required. :paramtype id: str @@ -7701,9 +8503,9 @@ def __init__( 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 - ): + create_mode: Optional[Union[str, "_models.CreateMode"]] = None, + **kwargs: Any + ) -> None: """ :keyword id: Name of the Cosmos DB MongoDB collection. Required. :paramtype id: str @@ -7792,8 +8594,8 @@ def __init__( identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.MongoDBCollectionGetPropertiesResource"] = None, options: Optional["_models.MongoDBCollectionGetPropertiesOptions"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -7833,7 +8635,7 @@ class MongoDBCollectionListResult(_serialization.Model): "value": {"key": "value", "type": "[MongoDBCollectionGetResults]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -7896,8 +8698,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -7941,8 +8743,8 @@ def __init__( *, throughput: Optional[int] = None, autoscale_settings: Optional["_models.AutoscaleSettings"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. @@ -7982,9 +8784,9 @@ def __init__( *, id: str, # pylint: disable=redefined-builtin restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, - create_mode: Union[str, "_models.CreateMode"] = "Default", - **kwargs - ): + create_mode: Optional[Union[str, "_models.CreateMode"]] = None, + **kwargs: Any + ) -> None: """ :keyword id: Name of the Cosmos DB MongoDB database. Required. :paramtype id: str @@ -8044,9 +8846,9 @@ def __init__( *, id: str, # pylint: disable=redefined-builtin restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, - create_mode: Union[str, "_models.CreateMode"] = "Default", - **kwargs - ): + create_mode: Optional[Union[str, "_models.CreateMode"]] = None, + **kwargs: Any + ) -> None: """ :keyword id: Name of the Cosmos DB MongoDB database. Required. :paramtype id: str @@ -8118,8 +8920,8 @@ def __init__( identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.MongoDBDatabaseGetPropertiesResource"] = None, options: Optional["_models.MongoDBDatabaseGetPropertiesOptions"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -8159,7 +8961,7 @@ class MongoDBDatabaseListResult(_serialization.Model): "value": {"key": "value", "type": "[MongoDBDatabaseGetResults]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -8184,8 +8986,8 @@ def __init__( *, key: Optional["_models.MongoIndexKeys"] = None, options: Optional["_models.MongoIndexOptions"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword key: Cosmos DB MongoDB collection index keys. :paramtype key: ~azure.mgmt.cosmosdb.models.MongoIndexKeys @@ -8208,7 +9010,7 @@ class MongoIndexKeys(_serialization.Model): "keys": {"key": "keys", "type": "[str]"}, } - def __init__(self, *, keys: Optional[List[str]] = None, **kwargs): + 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] @@ -8231,7 +9033,9 @@ class MongoIndexOptions(_serialization.Model): "unique": {"key": "unique", "type": "bool"}, } - def __init__(self, *, expire_after_seconds: Optional[int] = None, unique: Optional[bool] = None, **kwargs): + 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 @@ -8279,8 +9083,8 @@ def __init__( database_name: Optional[str] = None, privileges: Optional[List["_models.Privilege"]] = None, roles: Optional[List["_models.Role"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword role_name: A user-friendly name for the Role Definition. Must be unique for the database account. @@ -8359,8 +9163,8 @@ def __init__( database_name: Optional[str] = None, privileges: Optional[List["_models.Privilege"]] = None, roles: Optional[List["_models.Role"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword role_name: A user-friendly name for the Role Definition. Must be unique for the database account. @@ -8403,7 +9207,7 @@ class MongoRoleDefinitionListResult(_serialization.Model): "value": {"key": "value", "type": "[MongoRoleDefinitionGetResults]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -8446,8 +9250,8 @@ def __init__( custom_data: Optional[str] = None, roles: Optional[List["_models.Role"]] = None, mechanisms: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword user_name: The user name for User Definition. :paramtype user_name: str @@ -8527,8 +9331,8 @@ def __init__( custom_data: Optional[str] = None, roles: Optional[List["_models.Role"]] = None, mechanisms: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword user_name: The user name for User Definition. :paramtype user_name: str @@ -8571,7 +9375,7 @@ class MongoUserDefinitionListResult(_serialization.Model): "value": {"key": "value", "type": "[MongoUserDefinitionGetResults]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -8611,7 +9415,7 @@ class NotebookWorkspace(ARMProxyResource): "status": {"key": "properties.status", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.notebook_server_endpoint = None @@ -8640,7 +9444,7 @@ class NotebookWorkspaceConnectionInfoResult(_serialization.Model): "notebook_server_endpoint": {"key": "notebookServerEndpoint", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.auth_token = None @@ -8672,7 +9476,7 @@ class NotebookWorkspaceCreateUpdateParameters(ARMProxyResource): "type": {"key": "type", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) @@ -8688,7 +9492,7 @@ class NotebookWorkspaceListResult(_serialization.Model): "value": {"key": "value", "type": "[NotebookWorkspace]"}, } - def __init__(self, *, value: Optional[List["_models.NotebookWorkspace"]] = None, **kwargs): + 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] @@ -8711,7 +9515,9 @@ class Operation(_serialization.Model): "display": {"key": "display", "type": "OperationDisplay"}, } - def __init__(self, *, name: Optional[str] = None, display: Optional["_models.OperationDisplay"] = None, **kwargs): + 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 @@ -8750,8 +9556,8 @@ def __init__( resource: Optional[str] = None, operation: Optional[str] = None, description: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword provider: Service provider: Microsoft.ResourceProvider. :paramtype provider: str @@ -8770,7 +9576,8 @@ def __init__( 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. + """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] @@ -8783,7 +9590,9 @@ class OperationListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.Operation"]] = None, next_link: Optional[str] = None, **kwargs): + 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] @@ -8842,7 +9651,7 @@ class PartitionMetric(Metric): "partition_key_range_id": {"key": "partitionKeyRangeId", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.partition_id = None @@ -8866,7 +9675,7 @@ class PartitionMetricListResult(_serialization.Model): "value": {"key": "value", "type": "[PartitionMetric]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -8906,7 +9715,7 @@ class Usage(_serialization.Model): "current_value": {"key": "currentValue", "type": "int"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.unit = None @@ -8958,7 +9767,7 @@ class PartitionUsage(Usage): "partition_key_range_id": {"key": "partitionKeyRangeId", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.partition_id = None @@ -8983,7 +9792,7 @@ class PartitionUsagesResult(_serialization.Model): "value": {"key": "value", "type": "[PartitionUsage]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -9027,7 +9836,7 @@ class PercentileMetric(_serialization.Model): "metric_values": {"key": "metricValues", "type": "[PercentileMetricValue]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.start_time = None @@ -9055,7 +9864,7 @@ class PercentileMetricListResult(_serialization.Model): "value": {"key": "value", "type": "[PercentileMetric]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -9126,7 +9935,7 @@ class PercentileMetricValue(MetricValue): # pylint: disable=too-many-instance-a "p99": {"key": "P99", "type": "float"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.p10 = None @@ -9168,8 +9977,8 @@ def __init__( *, migration_state: Optional["_models.BackupPolicyMigrationState"] = None, periodic_mode_properties: Optional["_models.PeriodicModeProperties"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword migration_state: The object representing the state of the migration between the backup policies. @@ -9178,7 +9987,7 @@ def __init__( :paramtype periodic_mode_properties: ~azure.mgmt.cosmosdb.models.PeriodicModeProperties """ super().__init__(migration_state=migration_state, **kwargs) - self.type = "Periodic" # type: str + self.type: str = "Periodic" self.periodic_mode_properties = periodic_mode_properties @@ -9213,8 +10022,8 @@ def __init__( 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 - ): + **kwargs: Any + ) -> None: """ :keyword backup_interval_in_minutes: An integer representing the interval in minutes between two backups. @@ -9248,8 +10057,8 @@ class Permission(_serialization.Model): } def __init__( - self, *, data_actions: Optional[List[str]] = None, not_data_actions: Optional[List[str]] = None, **kwargs - ): + self, *, data_actions: Optional[List[str]] = None, not_data_actions: Optional[List[str]] = None, **kwargs: Any + ) -> None: """ :keyword data_actions: An array of data actions that are allowed. :paramtype data_actions: list[str] @@ -9278,7 +10087,7 @@ class PhysicalPartitionId(_serialization.Model): "id": {"key": "id", "type": "str"}, } - def __init__(self, *, id: str, **kwargs): # pylint: disable=redefined-builtin + def __init__(self, *, id: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin """ :keyword id: Id of a physical partition. Required. :paramtype id: str @@ -9308,7 +10117,7 @@ class PhysicalPartitionStorageInfo(_serialization.Model): "storage_in_kb": {"key": "storageInKB", "type": "float"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -9337,7 +10146,7 @@ class PhysicalPartitionStorageInfoCollection(_serialization.Model): }, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.physical_partition_storage_info_collection = None @@ -9362,8 +10171,8 @@ def __init__( self, *, physical_partition_throughput_info: Optional[List["_models.PhysicalPartitionThroughputInfoResource"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword physical_partition_throughput_info: Array of physical partition throughput info objects. @@ -9394,7 +10203,9 @@ class PhysicalPartitionThroughputInfoResource(_serialization.Model): "throughput": {"key": "throughput", "type": "float"}, } - def __init__(self, *, id: str, throughput: Optional[float] = None, **kwargs): # pylint: disable=redefined-builtin + 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 @@ -9456,8 +10267,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.PhysicalPartitionThroughputInfoResultPropertiesResource"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -9497,8 +10308,8 @@ def __init__( self, *, physical_partition_throughput_info: Optional[List["_models.PhysicalPartitionThroughputInfoResource"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword physical_partition_throughput_info: Array of physical partition throughput info objects. @@ -9535,7 +10346,7 @@ class Resource(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -9544,7 +10355,8 @@ def __init__(self, **kwargs): class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + """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. @@ -9570,7 +10382,7 @@ class ProxyResource(Resource): "type": {"key": "type", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) @@ -9626,8 +10438,8 @@ def __init__( private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionStateProperty"] = None, group_id: Optional[str] = None, provisioning_state: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword private_endpoint: Private endpoint which the connection belongs to. :paramtype private_endpoint: ~azure.mgmt.cosmosdb.models.PrivateEndpointProperty @@ -9658,7 +10470,7 @@ class PrivateEndpointConnectionListResult(_serialization.Model): "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, } - def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnection"]] = None, **kwargs): + 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] @@ -9678,7 +10490,7 @@ class PrivateEndpointProperty(_serialization.Model): "id": {"key": "id", "type": "str"}, } - def __init__(self, *, id: Optional[str] = None, **kwargs): # pylint: disable=redefined-builtin + 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 @@ -9724,7 +10536,7 @@ class PrivateLinkResource(ARMProxyResource): "required_zone_names": {"key": "properties.requiredZoneNames", "type": "[str]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.group_id = None @@ -9743,7 +10555,7 @@ class PrivateLinkResourceListResult(_serialization.Model): "value": {"key": "value", "type": "[PrivateLinkResource]"}, } - def __init__(self, *, value: Optional[List["_models.PrivateLinkResource"]] = None, **kwargs): + 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] @@ -9776,7 +10588,7 @@ class PrivateLinkServiceConnectionStateProperty(_serialization.Model): "actions_required": {"key": "actionsRequired", "type": "str"}, } - def __init__(self, *, status: Optional[str] = None, description: Optional[str] = None, **kwargs): + 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 @@ -9804,8 +10616,12 @@ class Privilege(_serialization.Model): } def __init__( - self, *, resource: Optional["_models.PrivilegeResource"] = None, actions: Optional[List[str]] = None, **kwargs - ): + 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 @@ -9831,7 +10647,7 @@ class PrivilegeResource(_serialization.Model): "collection": {"key": "collection", "type": "str"}, } - def __init__(self, *, db: Optional[str] = None, collection: Optional[str] = None, **kwargs): + 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 @@ -9895,8 +10711,8 @@ def __init__( location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -9958,8 +10774,8 @@ def __init__( throughput_policy: Union[str, "_models.ThroughputPolicyType"], target_physical_partition_throughput_info: List["_models.PhysicalPartitionThroughputInfoResource"], source_physical_partition_throughput_info: List["_models.PhysicalPartitionThroughputInfoResource"], - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword throughput_policy: ThroughputPolicy to apply for throughput redistribution. Required. Known values are: "none", "equal", and "custom". @@ -9996,7 +10812,7 @@ class RegionForOnlineOffline(_serialization.Model): "region": {"key": "region", "type": "str"}, } - def __init__(self, *, region: str, **kwargs): + def __init__(self, *, region: str, **kwargs: Any) -> None: """ :keyword region: Cosmos DB region, with spaces between words and each word capitalized. Required. @@ -10027,8 +10843,8 @@ def __init__( *, restore_source: Optional[str] = None, restore_timestamp_in_utc: Optional[datetime.datetime] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword restore_source: The id of the restorable database account from which the restore has to be initiated. For example: @@ -10064,8 +10880,8 @@ def __init__( *, restore_source: Optional[str] = None, restore_timestamp_in_utc: Optional[datetime.datetime] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword restore_source: The id of the restorable database account from which the restore has to be initiated. For example: @@ -10138,8 +10954,8 @@ def __init__( creation_time: Optional[datetime.datetime] = None, oldest_restorable_time: Optional[datetime.datetime] = None, deletion_time: Optional[datetime.datetime] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -10168,7 +10984,8 @@ def __init__( class RestorableDatabaseAccountsListResult(_serialization.Model): - """The List operation response, that contains the restorable database accounts and their properties. + """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. @@ -10184,7 +11001,7 @@ class RestorableDatabaseAccountsListResult(_serialization.Model): "value": {"key": "value", "type": "[RestorableDatabaseAccountGetResult]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -10218,7 +11035,9 @@ class RestorableGremlinDatabaseGetResult(_serialization.Model): "resource": {"key": "properties.resource", "type": "RestorableGremlinDatabasePropertiesResource"}, } - def __init__(self, *, resource: Optional["_models.RestorableGremlinDatabasePropertiesResource"] = None, **kwargs): + def __init__( + self, *, resource: Optional["_models.RestorableGremlinDatabasePropertiesResource"] = None, **kwargs: Any + ) -> None: """ :keyword resource: The resource of an Azure Cosmos DB Gremlin database event. :paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableGremlinDatabasePropertiesResource @@ -10264,7 +11083,7 @@ class RestorableGremlinDatabasePropertiesResource(_serialization.Model): "owner_resource_id": {"key": "ownerResourceId", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.rid = None @@ -10291,7 +11110,7 @@ class RestorableGremlinDatabasesListResult(_serialization.Model): "value": {"key": "value", "type": "[RestorableGremlinDatabaseGetResult]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -10325,7 +11144,9 @@ class RestorableGremlinGraphGetResult(_serialization.Model): "resource": {"key": "properties.resource", "type": "RestorableGremlinGraphPropertiesResource"}, } - def __init__(self, *, resource: Optional["_models.RestorableGremlinGraphPropertiesResource"] = None, **kwargs): + def __init__( + self, *, resource: Optional["_models.RestorableGremlinGraphPropertiesResource"] = None, **kwargs: Any + ) -> None: """ :keyword resource: The resource of an Azure Cosmos DB Gremlin graph event. :paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableGremlinGraphPropertiesResource @@ -10371,7 +11192,7 @@ class RestorableGremlinGraphPropertiesResource(_serialization.Model): "owner_resource_id": {"key": "ownerResourceId", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.rid = None @@ -10398,7 +11219,7 @@ class RestorableGremlinGraphsListResult(_serialization.Model): "value": {"key": "value", "type": "[RestorableGremlinGraphGetResult]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -10435,7 +11256,9 @@ class RestorableGremlinResourcesGetResult(_serialization.Model): "graph_names": {"key": "graphNames", "type": "[str]"}, } - def __init__(self, *, database_name: Optional[str] = None, graph_names: Optional[List[str]] = None, **kwargs): + def __init__( + self, *, database_name: Optional[str] = None, graph_names: Optional[List[str]] = None, **kwargs: Any + ) -> None: """ :keyword database_name: The name of the gremlin database available for restore. :paramtype database_name: str @@ -10468,7 +11291,7 @@ class RestorableGremlinResourcesListResult(_serialization.Model): "value": {"key": "value", "type": "[RestorableGremlinResourcesGetResult]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -10506,7 +11329,7 @@ class RestorableLocationResource(_serialization.Model): "deletion_time": {"key": "deletionTime", "type": "iso-8601"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.location_name = None @@ -10543,7 +11366,9 @@ class RestorableMongodbCollectionGetResult(_serialization.Model): "resource": {"key": "properties.resource", "type": "RestorableMongodbCollectionPropertiesResource"}, } - def __init__(self, *, resource: Optional["_models.RestorableMongodbCollectionPropertiesResource"] = None, **kwargs): + 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 @@ -10589,7 +11414,7 @@ class RestorableMongodbCollectionPropertiesResource(_serialization.Model): "owner_resource_id": {"key": "ownerResourceId", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.rid = None @@ -10616,7 +11441,7 @@ class RestorableMongodbCollectionsListResult(_serialization.Model): "value": {"key": "value", "type": "[RestorableMongodbCollectionGetResult]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -10650,7 +11475,9 @@ class RestorableMongodbDatabaseGetResult(_serialization.Model): "resource": {"key": "properties.resource", "type": "RestorableMongodbDatabasePropertiesResource"}, } - def __init__(self, *, resource: Optional["_models.RestorableMongodbDatabasePropertiesResource"] = None, **kwargs): + def __init__( + self, *, resource: Optional["_models.RestorableMongodbDatabasePropertiesResource"] = None, **kwargs: Any + ) -> None: """ :keyword resource: The resource of an Azure Cosmos DB MongoDB database event. :paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableMongodbDatabasePropertiesResource @@ -10696,7 +11523,7 @@ class RestorableMongodbDatabasePropertiesResource(_serialization.Model): "owner_resource_id": {"key": "ownerResourceId", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.rid = None @@ -10723,7 +11550,7 @@ class RestorableMongodbDatabasesListResult(_serialization.Model): "value": {"key": "value", "type": "[RestorableMongodbDatabaseGetResult]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -10760,7 +11587,9 @@ class RestorableMongodbResourcesGetResult(_serialization.Model): "collection_names": {"key": "collectionNames", "type": "[str]"}, } - def __init__(self, *, database_name: Optional[str] = None, collection_names: Optional[List[str]] = None, **kwargs): + 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 @@ -10792,7 +11621,7 @@ class RestorableMongodbResourcesListResult(_serialization.Model): "value": {"key": "value", "type": "[RestorableMongodbResourcesGetResult]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -10826,7 +11655,9 @@ class RestorableSqlContainerGetResult(_serialization.Model): "resource": {"key": "properties.resource", "type": "RestorableSqlContainerPropertiesResource"}, } - def __init__(self, *, resource: Optional["_models.RestorableSqlContainerPropertiesResource"] = None, **kwargs): + def __init__( + self, *, resource: Optional["_models.RestorableSqlContainerPropertiesResource"] = None, **kwargs: Any + ) -> None: """ :keyword resource: The resource of an Azure Cosmos DB SQL container event. :paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableSqlContainerPropertiesResource @@ -10877,8 +11708,8 @@ class RestorableSqlContainerPropertiesResource(_serialization.Model): } def __init__( - self, *, container: Optional["_models.RestorableSqlContainerPropertiesResourceContainer"] = None, **kwargs - ): + self, *, container: Optional["_models.RestorableSqlContainerPropertiesResourceContainer"] = None, **kwargs: Any + ) -> None: """ :keyword container: Cosmos DB SQL container resource object. :paramtype container: @@ -10953,9 +11784,9 @@ def __init__( 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", - **kwargs - ): + create_mode: Optional[Union[str, "_models.CreateMode"]] = None, + **kwargs: Any + ) -> None: """ :keyword id: Name of the Cosmos DB SQL container. Required. :paramtype id: str @@ -11077,9 +11908,9 @@ def __init__( 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", - **kwargs - ): + create_mode: Optional[Union[str, "_models.CreateMode"]] = None, + **kwargs: Any + ) -> None: """ :keyword id: Name of the Cosmos DB SQL container. Required. :paramtype id: str @@ -11152,7 +11983,7 @@ class RestorableSqlContainersListResult(_serialization.Model): "value": {"key": "value", "type": "[RestorableSqlContainerGetResult]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -11186,7 +12017,9 @@ class RestorableSqlDatabaseGetResult(_serialization.Model): "resource": {"key": "properties.resource", "type": "RestorableSqlDatabasePropertiesResource"}, } - def __init__(self, *, resource: Optional["_models.RestorableSqlDatabasePropertiesResource"] = None, **kwargs): + def __init__( + self, *, resource: Optional["_models.RestorableSqlDatabasePropertiesResource"] = None, **kwargs: Any + ) -> None: """ :keyword resource: The resource of an Azure Cosmos DB SQL database event. :paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableSqlDatabasePropertiesResource @@ -11236,8 +12069,8 @@ class RestorableSqlDatabasePropertiesResource(_serialization.Model): } def __init__( - self, *, database: Optional["_models.RestorableSqlDatabasePropertiesResourceDatabase"] = None, **kwargs - ): + self, *, database: Optional["_models.RestorableSqlDatabasePropertiesResourceDatabase"] = None, **kwargs: Any + ) -> None: """ :keyword database: Cosmos DB SQL database resource object. :paramtype database: @@ -11281,9 +12114,9 @@ def __init__( *, id: str, # pylint: disable=redefined-builtin restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, - create_mode: Union[str, "_models.CreateMode"] = "Default", - **kwargs - ): + create_mode: Optional[Union[str, "_models.CreateMode"]] = None, + **kwargs: Any + ) -> None: """ :keyword id: Name of the Cosmos DB SQL database. Required. :paramtype id: str @@ -11358,9 +12191,9 @@ def __init__( *, id: str, # pylint: disable=redefined-builtin restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, - create_mode: Union[str, "_models.CreateMode"] = "Default", - **kwargs - ): + create_mode: Optional[Union[str, "_models.CreateMode"]] = None, + **kwargs: Any + ) -> None: """ :keyword id: Name of the Cosmos DB SQL database. Required. :paramtype id: str @@ -11399,7 +12232,7 @@ class RestorableSqlDatabasesListResult(_serialization.Model): "value": {"key": "value", "type": "[RestorableSqlDatabaseGetResult]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -11436,7 +12269,9 @@ class RestorableSqlResourcesGetResult(_serialization.Model): "collection_names": {"key": "collectionNames", "type": "[str]"}, } - def __init__(self, *, database_name: Optional[str] = None, collection_names: Optional[List[str]] = None, **kwargs): + 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 @@ -11468,7 +12303,7 @@ class RestorableSqlResourcesListResult(_serialization.Model): "value": {"key": "value", "type": "[RestorableSqlResourcesGetResult]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -11502,7 +12337,9 @@ class RestorableTableGetResult(_serialization.Model): "resource": {"key": "properties.resource", "type": "RestorableTablePropertiesResource"}, } - def __init__(self, *, resource: Optional["_models.RestorableTablePropertiesResource"] = None, **kwargs): + def __init__( + self, *, resource: Optional["_models.RestorableTablePropertiesResource"] = None, **kwargs: Any + ) -> None: """ :keyword resource: The resource of an Azure Cosmos DB Table event. :paramtype resource: ~azure.mgmt.cosmosdb.models.RestorableTablePropertiesResource @@ -11548,7 +12385,7 @@ class RestorableTablePropertiesResource(_serialization.Model): "owner_resource_id": {"key": "ownerResourceId", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.rid = None @@ -11583,7 +12420,7 @@ class RestorableTableResourcesGetResult(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -11608,7 +12445,7 @@ class RestorableTableResourcesListResult(_serialization.Model): "value": {"key": "value", "type": "[RestorableTableResourcesGetResult]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -11631,7 +12468,7 @@ class RestorableTablesListResult(_serialization.Model): "value": {"key": "value", "type": "[RestorableTableGetResult]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -11678,8 +12515,8 @@ def __init__( 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 - ): + **kwargs: Any + ) -> None: """ :keyword restore_source: The id of the restorable database account from which the restore has to be initiated. For example: @@ -11758,8 +12595,8 @@ def __init__( location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -11796,7 +12633,7 @@ class RetrieveThroughputPropertiesResource(_serialization.Model): "physical_partition_ids": {"key": "physicalPartitionIds", "type": "[PhysicalPartitionId]"}, } - def __init__(self, *, physical_partition_ids: List["_models.PhysicalPartitionId"], **kwargs): + def __init__(self, *, physical_partition_ids: List["_models.PhysicalPartitionId"], **kwargs: Any) -> None: """ :keyword physical_partition_ids: Array of PhysicalPartitionId objects. Required. :paramtype physical_partition_ids: list[~azure.mgmt.cosmosdb.models.PhysicalPartitionId] @@ -11819,7 +12656,7 @@ class Role(_serialization.Model): "role": {"key": "role", "type": "str"}, } - def __init__(self, *, db: Optional[str] = None, role: Optional[str] = None, **kwargs): + 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 @@ -11842,7 +12679,7 @@ class SeedNode(_serialization.Model): "ip_address": {"key": "ipAddress", "type": "str"}, } - def __init__(self, *, ip_address: Optional[str] = None, **kwargs): + def __init__(self, *, ip_address: Optional[str] = None, **kwargs: Any) -> None: """ :keyword ip_address: IP address of this seed node. :paramtype ip_address: str @@ -11879,7 +12716,7 @@ class ServiceResource(ARMProxyResource): "properties": {"key": "properties", "type": "ServiceResourceProperties"}, } - def __init__(self, *, properties: Optional["_models.ServiceResourceProperties"] = None, **kwargs): + def __init__(self, *, properties: Optional["_models.ServiceResourceProperties"] = None, **kwargs: Any) -> None: """ :keyword properties: Services response resource. :paramtype properties: ~azure.mgmt.cosmosdb.models.ServiceResourceProperties @@ -11917,8 +12754,8 @@ def __init__( instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, instance_count: Optional[int] = None, service_type: Optional[Union[str, "_models.ServiceType"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", "Cosmos.D8s", and "Cosmos.D16s". @@ -11952,7 +12789,7 @@ class ServiceResourceListResult(_serialization.Model): "value": {"key": "value", "type": "[ServiceResource]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -11974,8 +12811,12 @@ class SpatialSpec(_serialization.Model): } def __init__( - self, *, path: Optional[str] = None, types: Optional[List[Union[str, "_models.SpatialType"]]] = None, **kwargs - ): + self, + *, + path: Optional[str] = None, + types: Optional[List[Union[str, "_models.SpatialType"]]] = 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/*). @@ -12045,8 +12886,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -12090,8 +12931,8 @@ def __init__( *, throughput: Optional[int] = None, autoscale_settings: Optional["_models.AutoscaleSettings"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. @@ -12179,9 +13020,9 @@ def __init__( 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", - **kwargs - ): + create_mode: Optional[Union[str, "_models.CreateMode"]] = None, + **kwargs: Any + ) -> None: """ :keyword id: Name of the Cosmos DB SQL container. Required. :paramtype id: str @@ -12289,8 +13130,8 @@ def __init__( identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.SqlContainerGetPropertiesResource"] = None, options: Optional["_models.SqlContainerGetPropertiesOptions"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -12330,7 +13171,7 @@ class SqlContainerListResult(_serialization.Model): "value": {"key": "value", "type": "[SqlContainerGetResults]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -12393,8 +13234,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -12438,8 +13279,8 @@ def __init__( *, throughput: Optional[int] = None, autoscale_settings: Optional["_models.AutoscaleSettings"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. @@ -12502,11 +13343,11 @@ def __init__( *, id: str, # pylint: disable=redefined-builtin restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, - create_mode: Union[str, "_models.CreateMode"] = "Default", + create_mode: Optional[Union[str, "_models.CreateMode"]] = None, colls: Optional[str] = None, users: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: Name of the Cosmos DB SQL database. Required. :paramtype id: str @@ -12586,8 +13427,8 @@ def __init__( identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.SqlDatabaseGetPropertiesResource"] = None, options: Optional["_models.SqlDatabaseGetPropertiesOptions"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -12627,7 +13468,7 @@ class SqlDatabaseListResult(_serialization.Model): "value": {"key": "value", "type": "[SqlDatabaseGetResults]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -12663,7 +13504,7 @@ class SqlDedicatedGatewayRegionalServiceResource(RegionalServiceResource): "sql_dedicated_gateway_endpoint": {"key": "sqlDedicatedGatewayEndpoint", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.sql_dedicated_gateway_endpoint = None @@ -12681,8 +13522,8 @@ class SqlDedicatedGatewayServiceResource(_serialization.Model): } def __init__( - self, *, properties: Optional["_models.SqlDedicatedGatewayServiceResourceProperties"] = None, **kwargs - ): + self, *, properties: Optional["_models.SqlDedicatedGatewayServiceResourceProperties"] = None, **kwargs: Any + ) -> None: """ :keyword properties: Properties for SqlDedicatedGatewayServiceResource. :paramtype properties: ~azure.mgmt.cosmosdb.models.SqlDedicatedGatewayServiceResourceProperties @@ -12747,8 +13588,8 @@ def __init__( instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, instance_count: Optional[int] = None, sql_dedicated_gateway_endpoint: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. @@ -12767,7 +13608,7 @@ def __init__( instance_count=instance_count, **kwargs ) - self.service_type = "SqlDedicatedGateway" # type: str + self.service_type: str = "SqlDedicatedGateway" self.sql_dedicated_gateway_endpoint = sql_dedicated_gateway_endpoint self.locations = None @@ -12798,8 +13639,8 @@ def __init__( role_definition_id: Optional[str] = None, scope: Optional[str] = None, principal_id: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword role_definition_id: The unique identifier for the associated Role Definition. :paramtype role_definition_id: str @@ -12860,8 +13701,8 @@ def __init__( role_definition_id: Optional[str] = None, scope: Optional[str] = None, principal_id: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword role_definition_id: The unique identifier for the associated Role Definition. :paramtype role_definition_id: str @@ -12896,7 +13737,7 @@ class SqlRoleAssignmentListResult(_serialization.Model): "value": {"key": "value", "type": "[SqlRoleAssignmentGetResults]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -12935,8 +13776,8 @@ def __init__( type: Optional[Union[str, "_models.RoleDefinitionType"]] = None, assignable_scopes: Optional[List[str]] = None, permissions: Optional[List["_models.Permission"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword role_name: A user-friendly name for the Role Definition. Must be unique for the database account. @@ -13010,8 +13851,8 @@ def __init__( type_properties_type: Optional[Union[str, "_models.RoleDefinitionType"]] = None, assignable_scopes: Optional[List[str]] = None, permissions: Optional[List["_models.Permission"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword role_name: A user-friendly name for the Role Definition. Must be unique for the database account. @@ -13052,7 +13893,7 @@ class SqlRoleDefinitionListResult(_serialization.Model): "value": {"key": "value", "type": "[SqlRoleDefinitionGetResults]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -13115,8 +13956,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -13160,7 +14001,9 @@ class SqlStoredProcedureResource(_serialization.Model): "body": {"key": "body", "type": "str"}, } - def __init__(self, *, id: str, body: Optional[str] = None, **kwargs): # pylint: disable=redefined-builtin + def __init__( + self, *, id: str, body: Optional[str] = None, **kwargs: Any # pylint: disable=redefined-builtin + ) -> None: """ :keyword id: Name of the Cosmos DB SQL storedProcedure. Required. :paramtype id: str @@ -13207,7 +14050,9 @@ class SqlStoredProcedureGetPropertiesResource(SqlStoredProcedureResource, Extend "body": {"key": "body", "type": "str"}, } - def __init__(self, *, id: str, body: Optional[str] = None, **kwargs): # pylint: disable=redefined-builtin + def __init__( + self, *, id: str, body: Optional[str] = None, **kwargs: Any # pylint: disable=redefined-builtin + ) -> None: """ :keyword id: Name of the Cosmos DB SQL storedProcedure. Required. :paramtype id: str @@ -13271,8 +14116,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.SqlStoredProcedureGetPropertiesResource"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -13309,7 +14154,7 @@ class SqlStoredProcedureListResult(_serialization.Model): "value": {"key": "value", "type": "[SqlStoredProcedureGetResults]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -13372,8 +14217,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -13431,8 +14276,8 @@ def __init__( body: Optional[str] = None, trigger_type: Optional[Union[str, "_models.TriggerType"]] = None, trigger_operation: Optional[Union[str, "_models.TriggerOperation"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: Name of the Cosmos DB SQL trigger. Required. :paramtype id: str @@ -13500,8 +14345,8 @@ def __init__( body: Optional[str] = None, trigger_type: Optional[Union[str, "_models.TriggerType"]] = None, trigger_operation: Optional[Union[str, "_models.TriggerOperation"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: Name of the Cosmos DB SQL trigger. Required. :paramtype id: str @@ -13572,8 +14417,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.SqlTriggerGetPropertiesResource"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -13610,7 +14455,7 @@ class SqlTriggerListResult(_serialization.Model): "value": {"key": "value", "type": "[SqlTriggerGetResults]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -13673,8 +14518,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -13718,7 +14563,9 @@ class SqlUserDefinedFunctionResource(_serialization.Model): "body": {"key": "body", "type": "str"}, } - def __init__(self, *, id: str, body: Optional[str] = None, **kwargs): # pylint: disable=redefined-builtin + 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 @@ -13765,7 +14612,9 @@ class SqlUserDefinedFunctionGetPropertiesResource(SqlUserDefinedFunctionResource "body": {"key": "body", "type": "str"}, } - def __init__(self, *, id: str, body: Optional[str] = None, **kwargs): # pylint: disable=redefined-builtin + 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 @@ -13829,8 +14678,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.SqlUserDefinedFunctionGetPropertiesResource"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -13867,7 +14716,7 @@ class SqlUserDefinedFunctionListResult(_serialization.Model): "value": {"key": "value", "type": "[SqlUserDefinedFunctionGetResults]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -13910,8 +14759,8 @@ def __init__( last_modified_by: Optional[str] = None, last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword created_by: The identity that created the resource. :paramtype created_by: str @@ -13994,8 +14843,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -14039,8 +14888,8 @@ def __init__( *, throughput: Optional[int] = None, autoscale_settings: Optional["_models.AutoscaleSettings"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. @@ -14068,7 +14917,7 @@ class TableResource(_serialization.Model): "id": {"key": "id", "type": "str"}, } - def __init__(self, *, id: str, **kwargs): # pylint: disable=redefined-builtin + def __init__(self, *, id: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin """ :keyword id: Name of the Cosmos DB table. Required. :paramtype id: str @@ -14109,7 +14958,7 @@ class TableGetPropertiesResource(TableResource, ExtendedResourceProperties): "id": {"key": "id", "type": "str"}, } - def __init__(self, *, id: str, **kwargs): # pylint: disable=redefined-builtin + def __init__(self, *, id: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin """ :keyword id: Name of the Cosmos DB table. Required. :paramtype id: str @@ -14174,8 +15023,8 @@ def __init__( identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.TableGetPropertiesResource"] = None, options: Optional["_models.TableGetPropertiesOptions"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -14215,7 +15064,7 @@ class TableListResult(_serialization.Model): "value": {"key": "value", "type": "[TableGetResults]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -14236,7 +15085,9 @@ class ThroughputPolicyResource(_serialization.Model): "increment_percent": {"key": "incrementPercent", "type": "int"}, } - def __init__(self, *, is_enabled: Optional[bool] = None, increment_percent: Optional[int] = None, **kwargs): + def __init__( + self, *, is_enabled: Optional[bool] = None, increment_percent: Optional[int] = None, **kwargs: Any + ) -> None: """ :keyword is_enabled: Determines whether the ThroughputPolicy is active or not. :paramtype is_enabled: bool @@ -14250,7 +15101,8 @@ def __init__(self, *, is_enabled: Optional[bool] = None, increment_percent: Opti class ThroughputSettingsResource(_serialization.Model): - """Cosmos DB resource throughput object. Either throughput is required or autoscaleSettings is required, but not both. + """Cosmos DB resource throughput object. Either throughput is required or autoscaleSettings is + required, but not both. Variables are only populated by the server, and will be ignored when sending a request. @@ -14283,8 +15135,8 @@ def __init__( *, throughput: Optional[int] = None, autoscale_settings: Optional["_models.AutoscaleSettingsResource"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword throughput: Value of the Cosmos DB resource throughput. Either throughput is required or autoscaleSettings is required, but not both. @@ -14347,8 +15199,8 @@ def __init__( *, throughput: Optional[int] = None, autoscale_settings: Optional["_models.AutoscaleSettingsResource"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword throughput: Value of the Cosmos DB resource throughput. Either throughput is required or autoscaleSettings is required, but not both. @@ -14416,8 +15268,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.ThroughputSettingsGetPropertiesResource"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -14489,8 +15341,8 @@ def __init__( location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -14511,7 +15363,8 @@ def __init__( class UniqueKey(_serialization.Model): - """The unique key on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service. + """The unique key on that enforces uniqueness constraint on documents in the collection in the + Azure Cosmos DB service. :ivar paths: List of paths must be unique for each document in the Azure Cosmos DB service. :vartype paths: list[str] @@ -14521,7 +15374,7 @@ class UniqueKey(_serialization.Model): "paths": {"key": "paths", "type": "[str]"}, } - def __init__(self, *, paths: Optional[List[str]] = None, **kwargs): + def __init__(self, *, paths: Optional[List[str]] = None, **kwargs: Any) -> None: """ :keyword paths: List of paths must be unique for each document in the Azure Cosmos DB service. :paramtype paths: list[str] @@ -14531,7 +15384,8 @@ def __init__(self, *, paths: Optional[List[str]] = None, **kwargs): class UniqueKeyPolicy(_serialization.Model): - """The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + """The unique key policy configuration for specifying uniqueness constraints on documents in the + collection in the Azure Cosmos DB service. :ivar unique_keys: List of unique keys on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service. @@ -14542,7 +15396,7 @@ class UniqueKeyPolicy(_serialization.Model): "unique_keys": {"key": "uniqueKeys", "type": "[UniqueKey]"}, } - def __init__(self, *, unique_keys: Optional[List["_models.UniqueKey"]] = None, **kwargs): + def __init__(self, *, unique_keys: Optional[List["_models.UniqueKey"]] = None, **kwargs: Any) -> None: """ :keyword unique_keys: List of unique keys on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service. @@ -14569,7 +15423,7 @@ class UsagesResult(_serialization.Model): "value": {"key": "value", "type": "[Usage]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -14596,8 +15450,8 @@ def __init__( *, id: Optional[str] = None, # pylint: disable=redefined-builtin ignore_missing_v_net_service_endpoint: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. 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 b9aee75bbc64..793e28754919 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 @@ -29,6 +29,7 @@ from ._data_transfer_jobs_operations import DataTransferJobsOperations from ._cassandra_clusters_operations import CassandraClustersOperations from ._cassandra_data_centers_operations import CassandraDataCentersOperations +from ._cassandra_repair_operations import CassandraRepairOperations from ._notebook_workspaces_operations import NotebookWorkspacesOperations from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations from ._private_link_resources_operations import PrivateLinkResourcesOperations @@ -47,7 +48,7 @@ from ._service_operations import ServiceOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -74,6 +75,7 @@ "DataTransferJobsOperations", "CassandraClustersOperations", "CassandraDataCentersOperations", + "CassandraRepairOperations", "NotebookWorkspacesOperations", "PrivateEndpointConnectionsOperations", "PrivateLinkResourcesOperations", 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 6e172e7d1fd4..2169f1d98126 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 @@ -47,9 +47,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -60,7 +60,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -75,9 +75,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +92,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -107,9 +107,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,7 +127,7 @@ def build_get_request(resource_group_name: str, cluster_name: str, subscription_ ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -144,9 +144,9 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +164,7 @@ def build_delete_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -181,10 +181,10 @@ def build_create_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -202,7 +202,7 @@ def build_create_update_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -221,10 +221,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -242,7 +242,7 @@ def build_update_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -261,10 +261,10 @@ def build_invoke_command_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -282,7 +282,7 @@ def build_invoke_command_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -295,90 +295,15 @@ def build_invoke_command_request( return HttpRequest(method="POST", 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-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", min_length=1), - "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 = _format_url_section(_url, **path_format_arguments) - - # 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-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", min_length=1), - "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 = _format_url_section(_url, **path_format_arguments) - - # 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, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -396,7 +321,7 @@ def build_deallocate_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -413,9 +338,9 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -433,7 +358,7 @@ def build_start_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -450,9 +375,9 @@ def build_status_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -470,7 +395,7 @@ def build_status_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -512,10 +437,10 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ClusterResour _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ListClusters] + ) + cls: ClsType[_models.ListClusters] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -536,7 +461,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -552,7 +477,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -560,13 +485,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ListClusters", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -579,7 +504,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/cassandraClusters"} # type: ignore + list_by_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/cassandraClusters" + } @distributed_trace def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ClusterResource"]: @@ -596,10 +523,10 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ListClusters] + ) + cls: ClsType[_models.ListClusters] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -621,7 +548,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -637,7 +564,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -645,13 +572,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ListClusters", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -664,7 +591,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters" + } @distributed_trace def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.ClusterResource: @@ -691,10 +620,10 @@ def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterResource] + ) + cls: ClsType[_models.ClusterResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -706,9 +635,9 @@ def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _mo params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -725,7 +654,9 @@ def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _mo return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, **kwargs: Any @@ -741,10 +672,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -756,9 +687,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -771,7 +702,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } @distributed_trace def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[None]: @@ -797,13 +730,13 @@ def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -821,7 +754,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -833,9 +766,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } def _create_update_initial( self, resource_group_name: str, cluster_name: str, body: Union[_models.ClusterResource, IO], **kwargs: Any @@ -851,11 +786,11 @@ def _create_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ClusterResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -878,9 +813,9 @@ def _create_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -897,11 +832,13 @@ def _create_update_initial( deserialized = self._deserialize("ClusterResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _create_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + _create_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } @overload def begin_create_update( @@ -1013,16 +950,16 @@ def begin_create_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterResource] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ClusterResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_initial( # type: ignore + raw_result = self._create_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, body=body, @@ -1042,7 +979,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1054,9 +991,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + begin_create_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } def _update_initial( self, resource_group_name: str, cluster_name: str, body: Union[_models.ClusterResource, IO], **kwargs: Any @@ -1072,11 +1011,11 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ClusterResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1099,9 +1038,9 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1118,11 +1057,13 @@ def _update_initial( deserialized = self._deserialize("ClusterResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } @overload def begin_update( @@ -1229,16 +1170,16 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterResource] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ClusterResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + raw_result = self._update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, body=body, @@ -1258,7 +1199,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1270,9 +1211,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}" + } def _invoke_command_initial( self, resource_group_name: str, cluster_name: str, body: Union[_models.CommandPostBody, IO], **kwargs: Any @@ -1288,11 +1231,11 @@ def _invoke_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CommandOutput] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CommandOutput] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1315,9 +1258,9 @@ def _invoke_command_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1334,7 +1277,9 @@ def _invoke_command_initial( return deserialized - _invoke_command_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/invokeCommand"} # type: ignore + _invoke_command_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/invokeCommand" + } @overload def begin_invoke_command( @@ -1441,16 +1386,16 @@ def begin_invoke_command( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CommandOutput] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CommandOutput] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._invoke_command_initial( # type: ignore + raw_result = self._invoke_command_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, body=body, @@ -1470,7 +1415,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1482,165 +1427,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_invoke_command.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/invokeCommand"} # 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :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 = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ListBackups] - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_backups_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_backups.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - 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) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_backups.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups"} # type: ignore - - @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. + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: BackupResource or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.BackupResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupResource] - - 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, - template_url=self.get_backup.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("BackupResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_backup.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups/{backupId}"} # type: ignore + begin_invoke_command.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/invokeCommand" + } def _deallocate_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, **kwargs: Any @@ -1656,10 +1447,10 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_deallocate_request( resource_group_name=resource_group_name, @@ -1671,9 +1462,9 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1686,7 +1477,9 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _deallocate_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate"} # type: ignore + _deallocate_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate" + } @distributed_trace def begin_deallocate(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1714,13 +1507,13 @@ def begin_deallocate(self, resource_group_name: str, cluster_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._deallocate_initial( # type: ignore resource_group_name=resource_group_name, @@ -1738,7 +1531,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1750,9 +1543,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_deallocate.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate"} # type: ignore + begin_deallocate.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate" + } def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, **kwargs: Any @@ -1768,10 +1563,10 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_start_request( resource_group_name=resource_group_name, @@ -1783,9 +1578,9 @@ def _start_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1798,7 +1593,9 @@ def _start_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/start"} # type: ignore + _start_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/start" + } @distributed_trace def begin_start(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1826,13 +1623,13 @@ def begin_start(self, resource_group_name: str, cluster_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._start_initial( # type: ignore resource_group_name=resource_group_name, @@ -1850,7 +1647,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1862,9 +1659,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/start"} # type: ignore + begin_start.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/start" + } @distributed_trace def status( @@ -1893,10 +1692,10 @@ def status( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraClusterPublicStatus] + ) + cls: ClsType[_models.CassandraClusterPublicStatus] = kwargs.pop("cls", None) request = build_status_request( resource_group_name=resource_group_name, @@ -1908,9 +1707,9 @@ def status( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1927,4 +1726,6 @@ def status( return deserialized - status.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/status"} # type: ignore + status.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/status" + } 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 001712256b7d..d18704202600 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,9 +47,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +67,7 @@ def build_list_request(resource_group_name: str, cluster_name: str, subscription ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -84,9 +84,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -112,7 +112,7 @@ def build_get_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -129,9 +129,9 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -157,7 +157,7 @@ def build_delete_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -174,10 +174,10 @@ def build_create_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -203,7 +203,7 @@ def build_create_update_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -222,10 +222,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -251,7 +251,7 @@ def build_update_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -302,10 +302,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ListDataCenters] + ) + cls: ClsType[_models.ListDataCenters] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -328,7 +328,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -344,7 +344,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -352,13 +352,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ListDataCenters", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -371,7 +371,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters" + } @distributed_trace def get( @@ -402,10 +404,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataCenterResource] + ) + cls: ClsType[_models.DataCenterResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -418,9 +420,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -437,7 +439,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, data_center_name: str, **kwargs: Any @@ -453,10 +457,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -469,9 +473,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -484,7 +488,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } @distributed_trace def begin_delete( @@ -514,13 +520,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -539,7 +545,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -551,9 +557,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } def _create_update_initial( self, @@ -574,11 +582,11 @@ def _create_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataCenterResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DataCenterResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -602,9 +610,9 @@ def _create_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -621,11 +629,13 @@ def _create_update_initial( deserialized = self._deserialize("DataCenterResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _create_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + _create_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } @overload def begin_create_update( @@ -748,16 +758,16 @@ def begin_create_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataCenterResource] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DataCenterResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_initial( # type: ignore + raw_result = self._create_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, data_center_name=data_center_name, @@ -778,7 +788,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -790,9 +800,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + begin_create_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } def _update_initial( self, @@ -813,11 +825,11 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataCenterResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DataCenterResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -841,9 +853,9 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -860,11 +872,13 @@ def _update_initial( deserialized = self._deserialize("DataCenterResource", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } @overload def begin_update( @@ -984,16 +998,16 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataCenterResource] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DataCenterResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + raw_result = self._update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, data_center_name=data_center_name, @@ -1014,7 +1028,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1026,6 +1040,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}" + } diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_repair_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_repair_operations.py new file mode 100644 index 000000000000..b6e1c245cf74 --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_repair_operations.py @@ -0,0 +1,2059 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from .._serialization import Serializer +from .._vendor import _convert_request, _format_url_section + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_cluster_status_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: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairStatus", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_table_status_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: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairTables", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_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: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-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}/repairRuns", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, + cluster_name: str, + repair_run_id: str, + owner_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/owner/{ownerName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterName": _SERIALIZER.url( + "cluster_name", cluster_name, "str", max_length=100, min_length=1, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$" + ), + "repairRunId": _SERIALIZER.url("repair_run_id", repair_run_id, "str"), + "ownerName": _SERIALIZER.url("owner_name", owner_name, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_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: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-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}/repairRuns/list", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_pause_request( + resource_group_name: str, cluster_name: str, repair_run_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: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/pause", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterName": _SERIALIZER.url( + "cluster_name", cluster_name, "str", max_length=100, min_length=1, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$" + ), + "repairRunId": _SERIALIZER.url("repair_run_id", repair_run_id, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_resume_request( + resource_group_name: str, cluster_name: str, repair_run_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: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/resume", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterName": _SERIALIZER.url( + "cluster_name", cluster_name, "str", max_length=100, min_length=1, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$" + ), + "repairRunId": _SERIALIZER.url("repair_run_id", repair_run_id, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_segments_request( + resource_group_name: str, cluster_name: str, repair_run_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: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/segments", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterName": _SERIALIZER.url( + "cluster_name", cluster_name, "str", max_length=100, min_length=1, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$" + ), + "repairRunId": _SERIALIZER.url("repair_run_id", repair_run_id, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_show_request( + resource_group_name: str, cluster_name: str, repair_run_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: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/show", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterName": _SERIALIZER.url( + "cluster_name", cluster_name, "str", max_length=100, min_length=1, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$" + ), + "repairRunId": _SERIALIZER.url("repair_run_id", repair_run_id, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_abort_segment_request( + resource_group_name: str, + cluster_name: str, + repair_run_id: str, + segment_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: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/segments/{segmentId}/abort", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterName": _SERIALIZER.url( + "cluster_name", cluster_name, "str", max_length=100, min_length=1, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$" + ), + "repairRunId": _SERIALIZER.url("repair_run_id", repair_run_id, "str"), + "segmentId": _SERIALIZER.url("segment_id", segment_id, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_request( + resource_group_name: str, + cluster_name: str, + repair_run_id: str, + intensity_value: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/intensity/{intensityValue}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "clusterName": _SERIALIZER.url( + "cluster_name", cluster_name, "str", max_length=100, min_length=1, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$" + ), + "repairRunId": _SERIALIZER.url("repair_run_id", repair_run_id, "str"), + "intensityValue": _SERIALIZER.url("intensity_value", intensity_value, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class CassandraRepairOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.cosmosdb.CosmosDBManagementClient`'s + :attr:`cassandra_repair` 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") + + def _get_cluster_status_initial( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> _models.CassandraReaperClusterStatus: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.CassandraReaperClusterStatus] = kwargs.pop("cls", None) + + request = build_get_cluster_status_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._get_cluster_status_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CassandraReaperClusterStatus", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _get_cluster_status_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairStatus" + } + + @distributed_trace + def begin_get_cluster_status( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> LROPoller[_models.CassandraReaperClusterStatus]: + """get_cluster_status. + + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either CassandraReaperClusterStatus or the + result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraReaperClusterStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.CassandraReaperClusterStatus] = 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._get_cluster_status_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("CassandraReaperClusterStatus", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_get_cluster_status.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairStatus" + } + + def _get_table_status_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> str: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[str] = kwargs.pop("cls", None) + + request = build_get_table_status_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._get_table_status_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("str", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _get_table_status_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairTables" + } + + @distributed_trace + def begin_get_table_status(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[str]: + """get_table_status. + + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either str or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[str] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[str] = 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._get_table_status_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("str", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_get_table_status.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairTables" + } + + def _create_initial( + self, + resource_group_name: str, + cluster_name: str, + body: Union[_models.CassandraClusterRepairPublicResource, IO], + **kwargs: Any + ) -> _models.CassandraReaperRunStatus: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_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.CassandraReaperRunStatus] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IO, bytes)): + _content = body + else: + _json = self._serialize.body(body, "CassandraClusterRepairPublicResource") + + request = build_create_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, + template_url=self._create_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CassandraReaperRunStatus", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns" + } + + @overload + def begin_create( + self, + resource_group_name: str, + cluster_name: str, + body: _models.CassandraClusterRepairPublicResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CassandraReaperRunStatus]: + """create. + + :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: The properties specifying the desired state of repairRun to be created. Required. + :type body: ~azure.mgmt.cosmosdb.models.CassandraClusterRepairPublicResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either CassandraReaperRunStatus or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraReaperRunStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + cluster_name: str, + body: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CassandraReaperRunStatus]: + """create. + + :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: The properties specifying the desired state of repairRun to be created. Required. + :type body: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either CassandraReaperRunStatus or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraReaperRunStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + cluster_name: str, + body: Union[_models.CassandraClusterRepairPublicResource, IO], + **kwargs: Any + ) -> LROPoller[_models.CassandraReaperRunStatus]: + """create. + + :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: The properties specifying the desired state of repairRun to be created. Is either + a model type or a IO type. Required. + :type body: ~azure.mgmt.cosmosdb.models.CassandraClusterRepairPublicResource or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either CassandraReaperRunStatus or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraReaperRunStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_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.CassandraReaperRunStatus] = 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, + 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 + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("CassandraReaperRunStatus", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns" + } + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, cluster_name: str, repair_run_id: str, owner_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + owner_name=owner_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/owner/{ownerName}" + } + + @distributed_trace + def begin_delete( + self, resource_group_name: str, cluster_name: str, repair_run_id: str, owner_name: str, **kwargs: Any + ) -> LROPoller[None]: + """delete. + + :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 repair_run_id: Id of repair run created to repair Cassandra cluster. Required. + :type repair_run_id: str + :param owner_name: Owner Name that was used to create the Repair Run. Required. + :type owner_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + owner_name=owner_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/owner/{ownerName}" + } + + def _list_initial( + self, + resource_group_name: str, + cluster_name: str, + body: Optional[Union[_models.CassandraClusterRepairListFilter, IO]] = None, + **kwargs: Any + ) -> _models.CassandraReaperRunStatusFeedResponse: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_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.CassandraReaperRunStatusFeedResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IO, bytes)): + _content = body + else: + if body is not None: + _json = self._serialize.body(body, "CassandraClusterRepairListFilter") + else: + _json = None + + request = build_list_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, + template_url=self._list_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CassandraReaperRunStatusFeedResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _list_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/list" + } + + @overload + def begin_list( + self, + resource_group_name: str, + cluster_name: str, + body: Optional[_models.CassandraClusterRepairListFilter] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CassandraReaperRunStatusFeedResponse]: + """list. + + :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: Optional filter parameters to list repairs. Default value is None. + :type body: ~azure.mgmt.cosmosdb.models.CassandraClusterRepairListFilter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either CassandraReaperRunStatusFeedResponse or + the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraReaperRunStatusFeedResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_list( + self, + resource_group_name: str, + cluster_name: str, + body: Optional[IO] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CassandraReaperRunStatusFeedResponse]: + """list. + + :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: Optional filter parameters to list repairs. Default value is None. + :type body: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either CassandraReaperRunStatusFeedResponse or + the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraReaperRunStatusFeedResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_list( + self, + resource_group_name: str, + cluster_name: str, + body: Optional[Union[_models.CassandraClusterRepairListFilter, IO]] = None, + **kwargs: Any + ) -> LROPoller[_models.CassandraReaperRunStatusFeedResponse]: + """list. + + :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: Optional filter parameters to list repairs. Is either a model type or a IO type. + Default value is None. + :type body: ~azure.mgmt.cosmosdb.models.CassandraClusterRepairListFilter or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either CassandraReaperRunStatusFeedResponse or + the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraReaperRunStatusFeedResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_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.CassandraReaperRunStatusFeedResponse] = 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_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 + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("CassandraReaperRunStatusFeedResponse", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/list" + } + + def _pause_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, cluster_name: str, repair_run_id: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_pause_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._pause_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _pause_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/pause" + } + + @distributed_trace + def begin_pause( + self, resource_group_name: str, cluster_name: str, repair_run_id: str, **kwargs: Any + ) -> LROPoller[None]: + """pause. + + :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 repair_run_id: Id of repair run created to repair Cassandra cluster. Required. + :type repair_run_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = 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._pause_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_pause.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/pause" + } + + def _resume_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, cluster_name: str, repair_run_id: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_resume_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._resume_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _resume_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/resume" + } + + @distributed_trace + def begin_resume( + self, resource_group_name: str, cluster_name: str, repair_run_id: str, **kwargs: Any + ) -> LROPoller[None]: + """resume. + + :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 repair_run_id: Id of repair run created to repair Cassandra cluster. Required. + :type repair_run_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = 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._resume_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_resume.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/resume" + } + + def _list_segments_initial( + self, resource_group_name: str, cluster_name: str, repair_run_id: str, **kwargs: Any + ) -> _models.CassandraRepairSegmentResourceFeedResponse: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.CassandraRepairSegmentResourceFeedResponse] = kwargs.pop("cls", None) + + request = build_list_segments_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._list_segments_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CassandraRepairSegmentResourceFeedResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _list_segments_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/segments" + } + + @distributed_trace + def begin_list_segments( + self, resource_group_name: str, cluster_name: str, repair_run_id: str, **kwargs: Any + ) -> LROPoller[_models.CassandraRepairSegmentResourceFeedResponse]: + """list_segments. + + :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 repair_run_id: Id of repair run created to repair Cassandra cluster. Required. + :type repair_run_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either + CassandraRepairSegmentResourceFeedResponse or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraRepairSegmentResourceFeedResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.CassandraRepairSegmentResourceFeedResponse] = 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_segments_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("CassandraRepairSegmentResourceFeedResponse", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_list_segments.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/segments" + } + + def _show_initial( + self, resource_group_name: str, cluster_name: str, repair_run_id: str, **kwargs: Any + ) -> _models.CassandraReaperRunStatus: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.CassandraReaperRunStatus] = kwargs.pop("cls", None) + + request = build_show_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._show_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CassandraReaperRunStatus", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _show_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/show" + } + + @distributed_trace + def begin_show( + self, resource_group_name: str, cluster_name: str, repair_run_id: str, **kwargs: Any + ) -> LROPoller[_models.CassandraReaperRunStatus]: + """show. + + :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 repair_run_id: Id of repair run created to repair Cassandra cluster. Required. + :type repair_run_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either CassandraReaperRunStatus or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraReaperRunStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[_models.CassandraReaperRunStatus] = 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._show_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("CassandraReaperRunStatus", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_show.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/show" + } + + def _abort_segment_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, cluster_name: str, repair_run_id: str, segment_id: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_abort_segment_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + segment_id=segment_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._abort_segment_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _abort_segment_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/segments/{segmentId}/abort" + } + + @distributed_trace + def begin_abort_segment( + self, resource_group_name: str, cluster_name: str, repair_run_id: str, segment_id: str, **kwargs: Any + ) -> LROPoller[None]: + """abort_segment. + + :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 repair_run_id: Id of repair run created to repair Cassandra cluster. Required. + :type repair_run_id: str + :param segment_id: Id of a segment of a repair run. Required. + :type segment_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = 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._abort_segment_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + segment_id=segment_id, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_abort_segment.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/segments/{segmentId}/abort" + } + + def _update_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, cluster_name: str, repair_run_id: str, intensity_value: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_update_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + intensity_value=intensity_value, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._update_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/intensity/{intensityValue}" + } + + @distributed_trace + def begin_update( + self, resource_group_name: str, cluster_name: str, repair_run_id: str, intensity_value: str, **kwargs: Any + ) -> LROPoller[None]: + """update. + + :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 repair_run_id: Id of repair run created to repair Cassandra cluster. Required. + :type repair_run_id: str + :param intensity_value: Floating point value representing intensity of the repair. Required. + :type intensity_value: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-11-15-preview"] = 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._update_initial( # type: ignore + resource_group_name=resource_group_name, + cluster_name=cluster_name, + repair_run_id=repair_run_id, + intensity_value=intensity_value, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/repairRuns/{repairRunId}/intensity/{intensityValue}" + } 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 4d7e794c82ba..ac27463a218b 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 @@ -49,9 +49,9 @@ def build_list_cassandra_keyspaces_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_cassandra_keyspaces_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -86,9 +86,9 @@ def build_get_cassandra_keyspace_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +107,7 @@ def build_get_cassandra_keyspace_request( "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -124,10 +124,10 @@ def build_create_update_cassandra_keyspace_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_create_update_cassandra_keyspace_request( "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -164,9 +164,9 @@ def build_delete_cassandra_keyspace_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) # Construct URL _url = kwargs.pop( "template_url", @@ -183,7 +183,7 @@ def build_delete_cassandra_keyspace_request( "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -197,9 +197,9 @@ def build_get_cassandra_keyspace_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +218,7 @@ def build_get_cassandra_keyspace_throughput_request( "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -235,10 +235,10 @@ def build_update_cassandra_keyspace_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -257,7 +257,7 @@ def build_update_cassandra_keyspace_throughput_request( "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -276,9 +276,9 @@ def build_migrate_cassandra_keyspace_to_autoscale_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -297,7 +297,7 @@ def build_migrate_cassandra_keyspace_to_autoscale_request( "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -314,9 +314,9 @@ def build_migrate_cassandra_keyspace_to_manual_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -335,7 +335,7 @@ def build_migrate_cassandra_keyspace_to_manual_throughput_request( "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -352,9 +352,9 @@ def build_list_cassandra_tables_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -373,7 +373,7 @@ def build_list_cassandra_tables_request( "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -395,9 +395,9 @@ def build_get_cassandra_table_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -417,7 +417,7 @@ def build_get_cassandra_table_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -439,10 +439,10 @@ def build_create_update_cassandra_table_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -462,7 +462,7 @@ def build_create_update_cassandra_table_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -485,9 +485,9 @@ def build_delete_cassandra_table_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) # Construct URL _url = kwargs.pop( "template_url", @@ -505,7 +505,7 @@ def build_delete_cassandra_table_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -524,9 +524,9 @@ def build_get_cassandra_table_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -546,7 +546,7 @@ def build_get_cassandra_table_throughput_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -568,10 +568,10 @@ def build_update_cassandra_table_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -591,7 +591,7 @@ def build_update_cassandra_table_throughput_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -615,9 +615,9 @@ def build_migrate_cassandra_table_to_autoscale_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -637,7 +637,7 @@ def build_migrate_cassandra_table_to_autoscale_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -659,9 +659,9 @@ def build_migrate_cassandra_table_to_manual_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -681,7 +681,7 @@ def build_migrate_cassandra_table_to_manual_throughput_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -698,9 +698,9 @@ def build_list_cassandra_views_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -719,7 +719,7 @@ def build_list_cassandra_views_request( "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -736,9 +736,9 @@ def build_get_cassandra_view_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -758,7 +758,7 @@ def build_get_cassandra_view_request( "viewName": _SERIALIZER.url("view_name", view_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -775,10 +775,10 @@ def build_create_update_cassandra_view_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -798,7 +798,7 @@ def build_create_update_cassandra_view_request( "viewName": _SERIALIZER.url("view_name", view_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -816,9 +816,9 @@ def build_delete_cassandra_view_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) # Construct URL _url = kwargs.pop( "template_url", @@ -836,7 +836,7 @@ def build_delete_cassandra_view_request( "viewName": _SERIALIZER.url("view_name", view_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -850,9 +850,9 @@ def build_get_cassandra_view_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -872,7 +872,7 @@ def build_get_cassandra_view_throughput_request( "viewName": _SERIALIZER.url("view_name", view_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -889,10 +889,10 @@ def build_update_cassandra_view_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -912,7 +912,7 @@ def build_update_cassandra_view_throughput_request( "viewName": _SERIALIZER.url("view_name", view_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -931,9 +931,9 @@ def build_migrate_cassandra_view_to_autoscale_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -953,7 +953,7 @@ def build_migrate_cassandra_view_to_autoscale_request( "viewName": _SERIALIZER.url("view_name", view_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -970,9 +970,9 @@ def build_migrate_cassandra_view_to_manual_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -992,7 +992,7 @@ def build_migrate_cassandra_view_to_manual_throughput_request( "viewName": _SERIALIZER.url("view_name", view_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1042,10 +1042,10 @@ def list_cassandra_keyspaces( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraKeyspaceListResult] + ) + cls: ClsType[_models.CassandraKeyspaceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1068,7 +1068,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -1084,7 +1084,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1092,13 +1092,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("CassandraKeyspaceListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1111,7 +1111,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_cassandra_keyspaces.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces"} # type: ignore + list_cassandra_keyspaces.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces" + } @distributed_trace def get_cassandra_keyspace( @@ -1143,10 +1145,10 @@ def get_cassandra_keyspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraKeyspaceGetResults] + ) + cls: ClsType[_models.CassandraKeyspaceGetResults] = kwargs.pop("cls", None) request = build_get_cassandra_keyspace_request( resource_group_name=resource_group_name, @@ -1159,9 +1161,9 @@ def get_cassandra_keyspace( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1178,7 +1180,9 @@ def get_cassandra_keyspace( return deserialized - get_cassandra_keyspace.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}"} # type: ignore + get_cassandra_keyspace.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}" + } def _create_update_cassandra_keyspace_initial( self, @@ -1199,11 +1203,11 @@ def _create_update_cassandra_keyspace_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CassandraKeyspaceGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.CassandraKeyspaceGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1229,9 +1233,9 @@ def _create_update_cassandra_keyspace_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1250,7 +1254,9 @@ def _create_update_cassandra_keyspace_initial( return deserialized - _create_update_cassandra_keyspace_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}"} # type: ignore + _create_update_cassandra_keyspace_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}" + } @overload def begin_create_update_cassandra_keyspace( @@ -1374,16 +1380,16 @@ def begin_create_update_cassandra_keyspace( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraKeyspaceGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CassandraKeyspaceGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_cassandra_keyspace_initial( # type: ignore + raw_result = self._create_update_cassandra_keyspace_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -1404,7 +1410,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1416,9 +1422,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_cassandra_keyspace.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}"} # type: ignore + begin_create_update_cassandra_keyspace.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}" + } def _delete_cassandra_keyspace_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any @@ -1434,10 +1442,10 @@ def _delete_cassandra_keyspace_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_cassandra_keyspace_request( resource_group_name=resource_group_name, @@ -1450,9 +1458,9 @@ def _delete_cassandra_keyspace_initial( # pylint: disable=inconsistent-return-s params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1465,7 +1473,9 @@ def _delete_cassandra_keyspace_initial( # pylint: disable=inconsistent-return-s if cls: return cls(pipeline_response, None, {}) - _delete_cassandra_keyspace_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}"} # type: ignore + _delete_cassandra_keyspace_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}" + } @distributed_trace def begin_delete_cassandra_keyspace( @@ -1495,13 +1505,13 @@ def begin_delete_cassandra_keyspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_cassandra_keyspace_initial( # type: ignore resource_group_name=resource_group_name, @@ -1520,7 +1530,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1532,9 +1542,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_cassandra_keyspace.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}"} # type: ignore + begin_delete_cassandra_keyspace.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}" + } @distributed_trace def get_cassandra_keyspace_throughput( @@ -1566,10 +1578,10 @@ def get_cassandra_keyspace_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_cassandra_keyspace_throughput_request( resource_group_name=resource_group_name, @@ -1582,9 +1594,9 @@ def get_cassandra_keyspace_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1601,7 +1613,9 @@ def get_cassandra_keyspace_throughput( return deserialized - get_cassandra_keyspace_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default"} # type: ignore + get_cassandra_keyspace_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default" + } def _update_cassandra_keyspace_throughput_initial( self, @@ -1622,11 +1636,11 @@ def _update_cassandra_keyspace_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1650,9 +1664,9 @@ def _update_cassandra_keyspace_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1671,7 +1685,9 @@ def _update_cassandra_keyspace_throughput_initial( return deserialized - _update_cassandra_keyspace_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default"} # type: ignore + _update_cassandra_keyspace_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default" + } @overload def begin_update_cassandra_keyspace_throughput( @@ -1795,16 +1811,16 @@ def begin_update_cassandra_keyspace_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_cassandra_keyspace_throughput_initial( # type: ignore + raw_result = self._update_cassandra_keyspace_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -1825,7 +1841,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1837,9 +1853,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_cassandra_keyspace_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default"} # type: ignore + begin_update_cassandra_keyspace_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default" + } def _migrate_cassandra_keyspace_to_autoscale_initial( self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any @@ -1855,10 +1873,10 @@ def _migrate_cassandra_keyspace_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_cassandra_keyspace_to_autoscale_request( resource_group_name=resource_group_name, @@ -1871,9 +1889,9 @@ def _migrate_cassandra_keyspace_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1892,7 +1910,9 @@ def _migrate_cassandra_keyspace_to_autoscale_initial( return deserialized - _migrate_cassandra_keyspace_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_cassandra_keyspace_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace def begin_migrate_cassandra_keyspace_to_autoscale( @@ -1923,15 +1943,15 @@ def begin_migrate_cassandra_keyspace_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_cassandra_keyspace_to_autoscale_initial( # type: ignore + raw_result = self._migrate_cassandra_keyspace_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -1950,7 +1970,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1962,9 +1982,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_cassandra_keyspace_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_cassandra_keyspace_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale" + } def _migrate_cassandra_keyspace_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any @@ -1980,10 +2002,10 @@ def _migrate_cassandra_keyspace_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_cassandra_keyspace_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -1996,9 +2018,9 @@ def _migrate_cassandra_keyspace_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2017,7 +2039,9 @@ def _migrate_cassandra_keyspace_to_manual_throughput_initial( return deserialized - _migrate_cassandra_keyspace_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_cassandra_keyspace_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def begin_migrate_cassandra_keyspace_to_manual_throughput( @@ -2048,15 +2072,15 @@ def begin_migrate_cassandra_keyspace_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_cassandra_keyspace_to_manual_throughput_initial( # type: ignore + raw_result = self._migrate_cassandra_keyspace_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -2075,7 +2099,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2087,9 +2111,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_cassandra_keyspace_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_cassandra_keyspace_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def list_cassandra_tables( @@ -2113,10 +2139,10 @@ def list_cassandra_tables( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraTableListResult] + ) + cls: ClsType[_models.CassandraTableListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2140,7 +2166,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -2156,7 +2182,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2164,13 +2190,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("CassandraTableListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2183,7 +2209,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_cassandra_tables.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables"} # type: ignore + list_cassandra_tables.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables" + } @distributed_trace def get_cassandra_table( @@ -2216,10 +2244,10 @@ def get_cassandra_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraTableGetResults] + ) + cls: ClsType[_models.CassandraTableGetResults] = kwargs.pop("cls", None) request = build_get_cassandra_table_request( resource_group_name=resource_group_name, @@ -2233,9 +2261,9 @@ def get_cassandra_table( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2252,7 +2280,9 @@ def get_cassandra_table( return deserialized - get_cassandra_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}"} # type: ignore + get_cassandra_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}" + } def _create_update_cassandra_table_initial( self, @@ -2274,11 +2304,11 @@ def _create_update_cassandra_table_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CassandraTableGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.CassandraTableGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2305,9 +2335,9 @@ def _create_update_cassandra_table_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2326,7 +2356,9 @@ def _create_update_cassandra_table_initial( return deserialized - _create_update_cassandra_table_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}"} # type: ignore + _create_update_cassandra_table_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}" + } @overload def begin_create_update_cassandra_table( @@ -2459,16 +2491,16 @@ def begin_create_update_cassandra_table( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraTableGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CassandraTableGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_cassandra_table_initial( # type: ignore + raw_result = self._create_update_cassandra_table_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -2490,7 +2522,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2502,9 +2534,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_cassandra_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}"} # type: ignore + begin_create_update_cassandra_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}" + } def _delete_cassandra_table_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any @@ -2520,10 +2554,10 @@ def _delete_cassandra_table_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_cassandra_table_request( resource_group_name=resource_group_name, @@ -2537,9 +2571,9 @@ def _delete_cassandra_table_initial( # pylint: disable=inconsistent-return-stat params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2552,7 +2586,9 @@ def _delete_cassandra_table_initial( # pylint: disable=inconsistent-return-stat if cls: return cls(pipeline_response, None, {}) - _delete_cassandra_table_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}"} # type: ignore + _delete_cassandra_table_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}" + } @distributed_trace def begin_delete_cassandra_table( @@ -2584,13 +2620,13 @@ def begin_delete_cassandra_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_cassandra_table_initial( # type: ignore resource_group_name=resource_group_name, @@ -2610,7 +2646,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2622,9 +2658,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_cassandra_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}"} # type: ignore + begin_delete_cassandra_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}" + } @distributed_trace def get_cassandra_table_throughput( @@ -2658,10 +2696,10 @@ def get_cassandra_table_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_cassandra_table_throughput_request( resource_group_name=resource_group_name, @@ -2675,9 +2713,9 @@ def get_cassandra_table_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2694,7 +2732,9 @@ def get_cassandra_table_throughput( return deserialized - get_cassandra_table_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default"} # type: ignore + get_cassandra_table_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default" + } def _update_cassandra_table_throughput_initial( self, @@ -2716,11 +2756,11 @@ def _update_cassandra_table_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2745,9 +2785,9 @@ def _update_cassandra_table_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2766,7 +2806,9 @@ def _update_cassandra_table_throughput_initial( return deserialized - _update_cassandra_table_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default"} # type: ignore + _update_cassandra_table_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default" + } @overload def begin_update_cassandra_table_throughput( @@ -2899,16 +2941,16 @@ def begin_update_cassandra_table_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_cassandra_table_throughput_initial( # type: ignore + raw_result = self._update_cassandra_table_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -2930,7 +2972,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2942,9 +2984,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_cassandra_table_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default"} # type: ignore + begin_update_cassandra_table_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default" + } def _migrate_cassandra_table_to_autoscale_initial( self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any @@ -2960,10 +3004,10 @@ def _migrate_cassandra_table_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_cassandra_table_to_autoscale_request( resource_group_name=resource_group_name, @@ -2977,9 +3021,9 @@ def _migrate_cassandra_table_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2998,7 +3042,9 @@ def _migrate_cassandra_table_to_autoscale_initial( return deserialized - _migrate_cassandra_table_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_cassandra_table_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace def begin_migrate_cassandra_table_to_autoscale( @@ -3031,15 +3077,15 @@ def begin_migrate_cassandra_table_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_cassandra_table_to_autoscale_initial( # type: ignore + raw_result = self._migrate_cassandra_table_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -3059,7 +3105,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3071,9 +3117,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_cassandra_table_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_cassandra_table_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale" + } def _migrate_cassandra_table_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any @@ -3089,10 +3137,10 @@ def _migrate_cassandra_table_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_cassandra_table_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -3106,9 +3154,9 @@ def _migrate_cassandra_table_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3127,7 +3175,9 @@ def _migrate_cassandra_table_to_manual_throughput_initial( return deserialized - _migrate_cassandra_table_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_cassandra_table_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def begin_migrate_cassandra_table_to_manual_throughput( @@ -3160,15 +3210,15 @@ def begin_migrate_cassandra_table_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_cassandra_table_to_manual_throughput_initial( # type: ignore + raw_result = self._migrate_cassandra_table_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -3188,7 +3238,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3200,9 +3250,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_cassandra_table_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_cassandra_table_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def list_cassandra_views( @@ -3226,10 +3278,10 @@ def list_cassandra_views( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraViewListResult] + ) + cls: ClsType[_models.CassandraViewListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -3253,7 +3305,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -3269,7 +3321,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -3277,13 +3329,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -3296,7 +3348,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_cassandra_views.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views"} # type: ignore + list_cassandra_views.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views" + } @distributed_trace def get_cassandra_view( @@ -3329,10 +3383,10 @@ def get_cassandra_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraViewGetResults] + ) + cls: ClsType[_models.CassandraViewGetResults] = kwargs.pop("cls", None) request = build_get_cassandra_view_request( resource_group_name=resource_group_name, @@ -3346,9 +3400,9 @@ def get_cassandra_view( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3365,7 +3419,9 @@ def get_cassandra_view( return deserialized - get_cassandra_view.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}"} # type: ignore + get_cassandra_view.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}" + } def _create_update_cassandra_view_initial( self, @@ -3387,11 +3443,11 @@ def _create_update_cassandra_view_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CassandraViewGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.CassandraViewGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -3416,9 +3472,9 @@ def _create_update_cassandra_view_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3437,7 +3493,9 @@ def _create_update_cassandra_view_initial( return deserialized - _create_update_cassandra_view_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}"} # type: ignore + _create_update_cassandra_view_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}" + } @overload def begin_create_update_cassandra_view( @@ -3570,16 +3628,16 @@ def begin_create_update_cassandra_view( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CassandraViewGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_cassandra_view_initial( # type: ignore + raw_result = self._create_update_cassandra_view_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -3601,7 +3659,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3613,9 +3671,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_cassandra_view.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}"} # type: ignore + begin_create_update_cassandra_view.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}" + } def _delete_cassandra_view_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any @@ -3631,10 +3691,10 @@ def _delete_cassandra_view_initial( # pylint: disable=inconsistent-return-state _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_cassandra_view_request( resource_group_name=resource_group_name, @@ -3648,9 +3708,9 @@ def _delete_cassandra_view_initial( # pylint: disable=inconsistent-return-state params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3663,7 +3723,9 @@ def _delete_cassandra_view_initial( # pylint: disable=inconsistent-return-state if cls: return cls(pipeline_response, None, {}) - _delete_cassandra_view_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}"} # type: ignore + _delete_cassandra_view_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}" + } @distributed_trace def begin_delete_cassandra_view( @@ -3695,13 +3757,13 @@ def begin_delete_cassandra_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_cassandra_view_initial( # type: ignore resource_group_name=resource_group_name, @@ -3721,7 +3783,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3733,9 +3795,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_cassandra_view.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}"} # type: ignore + begin_delete_cassandra_view.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}" + } @distributed_trace def get_cassandra_view_throughput( @@ -3769,10 +3833,10 @@ def get_cassandra_view_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_cassandra_view_throughput_request( resource_group_name=resource_group_name, @@ -3786,9 +3850,9 @@ def get_cassandra_view_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3805,7 +3869,9 @@ def get_cassandra_view_throughput( return deserialized - get_cassandra_view_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default"} # type: ignore + get_cassandra_view_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default" + } def _update_cassandra_view_throughput_initial( self, @@ -3827,11 +3893,11 @@ def _update_cassandra_view_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -3856,9 +3922,9 @@ def _update_cassandra_view_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3877,7 +3943,9 @@ def _update_cassandra_view_throughput_initial( return deserialized - _update_cassandra_view_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default"} # type: ignore + _update_cassandra_view_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default" + } @overload def begin_update_cassandra_view_throughput( @@ -4010,16 +4078,16 @@ def begin_update_cassandra_view_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_cassandra_view_throughput_initial( # type: ignore + raw_result = self._update_cassandra_view_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -4041,7 +4109,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -4053,9 +4121,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_cassandra_view_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default"} # type: ignore + begin_update_cassandra_view_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default" + } def _migrate_cassandra_view_to_autoscale_initial( self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any @@ -4071,10 +4141,10 @@ def _migrate_cassandra_view_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_cassandra_view_to_autoscale_request( resource_group_name=resource_group_name, @@ -4088,9 +4158,9 @@ def _migrate_cassandra_view_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4109,7 +4179,9 @@ def _migrate_cassandra_view_to_autoscale_initial( return deserialized - _migrate_cassandra_view_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_cassandra_view_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace def begin_migrate_cassandra_view_to_autoscale( @@ -4142,15 +4214,15 @@ def begin_migrate_cassandra_view_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_cassandra_view_to_autoscale_initial( # type: ignore + raw_result = self._migrate_cassandra_view_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -4170,7 +4242,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -4182,9 +4254,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_cassandra_view_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_cassandra_view_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale" + } def _migrate_cassandra_view_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any @@ -4200,10 +4274,10 @@ def _migrate_cassandra_view_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_cassandra_view_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -4217,9 +4291,9 @@ def _migrate_cassandra_view_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4238,7 +4312,9 @@ def _migrate_cassandra_view_to_manual_throughput_initial( return deserialized - _migrate_cassandra_view_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_cassandra_view_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def begin_migrate_cassandra_view_to_manual_throughput( @@ -4271,15 +4347,15 @@ def begin_migrate_cassandra_view_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_cassandra_view_to_manual_throughput_initial( # type: ignore + raw_result = self._migrate_cassandra_view_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -4299,7 +4375,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -4311,6 +4387,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_cassandra_view_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_cassandra_view_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput" + } 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 3fea3bea493f..66522f529449 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 @@ -54,9 +54,9 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +76,7 @@ def build_list_metrics_request( "collectionRid": _SERIALIZER.url("collection_rid", collection_rid, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -101,9 +101,9 @@ def build_list_usages_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -123,7 +123,7 @@ def build_list_usages_request( "collectionRid": _SERIALIZER.url("collection_rid", collection_rid, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -147,9 +147,9 @@ def build_list_metric_definitions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +169,7 @@ def build_list_metric_definitions_request( "collectionRid": _SERIALIZER.url("collection_rid", collection_rid, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -233,10 +233,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + ) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -262,7 +262,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -278,7 +278,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -286,13 +286,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("MetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -305,7 +305,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metrics" + } @distributed_trace def list_usages( @@ -340,10 +342,10 @@ def list_usages( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.UsagesResult] + ) + cls: ClsType[_models.UsagesResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -369,7 +371,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -385,7 +387,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -393,13 +395,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("UsagesResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -412,7 +414,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_usages.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/usages"} # type: ignore + list_usages.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/usages" + } @distributed_trace def list_metric_definitions( @@ -437,10 +441,10 @@ def list_metric_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricDefinitionsListResult] + ) + cls: ClsType[_models.MetricDefinitionsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -465,7 +469,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -481,7 +485,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -489,13 +493,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("MetricDefinitionsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -508,4 +512,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metric_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metricDefinitions"} # type: ignore + list_metric_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metricDefinitions" + } 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 b45407cae8e8..7510762850f8 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 @@ -54,9 +54,9 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +76,7 @@ def build_list_metrics_request( "collectionRid": _SERIALIZER.url("collection_rid", collection_rid, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -101,9 +101,9 @@ def build_list_usages_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -123,7 +123,7 @@ def build_list_usages_request( "collectionRid": _SERIALIZER.url("collection_rid", collection_rid, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -189,10 +189,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PartitionMetricListResult] + ) + cls: ClsType[_models.PartitionMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -218,7 +218,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -234,7 +234,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -242,13 +242,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("PartitionMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -261,7 +261,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics" + } @distributed_trace def list_usages( @@ -296,10 +298,10 @@ def list_usages( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PartitionUsagesResult] + ) + cls: ClsType[_models.PartitionUsagesResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -325,7 +327,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -341,7 +343,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -349,13 +351,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("PartitionUsagesResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -368,4 +370,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_usages.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/usages"} # type: ignore + list_usages.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/usages" + } 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 ebd6415611bc..42688849f89e 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 @@ -55,9 +55,9 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,7 +78,7 @@ def build_list_metrics_request( "collectionRid": _SERIALIZER.url("collection_rid", collection_rid, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -146,10 +146,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PartitionMetricListResult] + ) + cls: ClsType[_models.PartitionMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -176,7 +176,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -192,7 +192,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -200,13 +200,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("PartitionMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -219,4 +219,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics" + } 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 9e7ec0632f8f..e725350fb018 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 @@ -55,9 +55,9 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,7 +78,7 @@ def build_list_metrics_request( "collectionRid": _SERIALIZER.url("collection_rid", collection_rid, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -146,10 +146,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + ) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -176,7 +176,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -192,7 +192,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -200,13 +200,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("MetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -219,4 +219,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/metrics" + } 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 index 749e671f409c..034a52b30d42 100644 --- 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 @@ -47,10 +47,10 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_create_request( "jobName": _SERIALIZER.url("job_name", job_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -88,9 +88,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -109,7 +109,7 @@ def build_get_request( "jobName": _SERIALIZER.url("job_name", job_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -126,9 +126,9 @@ def build_pause_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -147,7 +147,7 @@ def build_pause_request( "jobName": _SERIALIZER.url("job_name", job_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -164,9 +164,9 @@ def build_resume_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -185,7 +185,7 @@ def build_resume_request( "jobName": _SERIALIZER.url("job_name", job_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -202,9 +202,9 @@ def build_cancel_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -223,7 +223,7 @@ def build_cancel_request( "jobName": _SERIALIZER.url("job_name", job_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -240,9 +240,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -260,7 +260,7 @@ def build_list_by_database_account_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -391,11 +391,11 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataTransferJobGetResults] + ) + 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 @@ -419,9 +419,9 @@ def create( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -438,7 +438,9 @@ def create( return deserialized - create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}"} # type: ignore + create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}" + } @distributed_trace def get( @@ -469,10 +471,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataTransferJobGetResults] + ) + cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -485,9 +487,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -504,7 +506,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}" + } @distributed_trace def pause( @@ -535,10 +539,10 @@ def pause( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataTransferJobGetResults] + ) + cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) request = build_pause_request( resource_group_name=resource_group_name, @@ -551,9 +555,9 @@ def pause( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -570,7 +574,9 @@ def pause( return deserialized - pause.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/pause"} # type: ignore + pause.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/pause" + } @distributed_trace def resume( @@ -601,10 +607,10 @@ def resume( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataTransferJobGetResults] + ) + cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) request = build_resume_request( resource_group_name=resource_group_name, @@ -617,9 +623,9 @@ def resume( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -636,7 +642,9 @@ def resume( return deserialized - resume.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/resume"} # type: ignore + resume.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/resume" + } @distributed_trace def cancel( @@ -667,10 +675,10 @@ def cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataTransferJobGetResults] + ) + cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) request = build_cancel_request( resource_group_name=resource_group_name, @@ -683,9 +691,9 @@ def cancel( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -702,7 +710,9 @@ def cancel( return deserialized - cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/cancel"} # type: ignore + cancel.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/cancel" + } @distributed_trace def list_by_database_account( @@ -724,10 +734,10 @@ def list_by_database_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataTransferJobFeedResults] + ) + cls: ClsType[_models.DataTransferJobFeedResults] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -750,7 +760,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -766,7 +776,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -774,13 +784,13 @@ 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) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -793,4 +803,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database_account.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs"} # type: ignore + list_by_database_account.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs" + } 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 e510756f32c2..65994692ed0b 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 @@ -47,9 +47,9 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -68,7 +68,7 @@ def build_list_metrics_request( "region": _SERIALIZER.url("region", region, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -124,10 +124,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + ) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -152,7 +152,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -168,7 +168,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -176,13 +176,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("MetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -195,4 +195,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/metrics" + } 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 12cd0459afeb..199ac07c4897 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 @@ -47,9 +47,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +67,7 @@ def build_get_request(resource_group_name: str, account_name: str, subscription_ ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -84,10 +84,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +105,7 @@ def build_update_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -124,10 +124,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -145,7 +145,7 @@ def build_create_or_update_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -163,9 +163,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) # Construct URL _url = kwargs.pop( "template_url", @@ -181,7 +181,7 @@ def build_delete_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -195,10 +195,10 @@ def build_failover_priority_change_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( "template_url", @@ -214,7 +214,7 @@ def build_failover_priority_change_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -230,9 +230,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +241,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -256,9 +256,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -273,7 +273,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -290,9 +290,9 @@ def build_list_keys_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -310,7 +310,7 @@ def build_list_keys_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -327,9 +327,9 @@ def build_list_connection_strings_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -347,7 +347,7 @@ def build_list_connection_strings_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -364,10 +364,10 @@ def build_offline_region_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -385,7 +385,7 @@ def build_offline_region_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -404,10 +404,10 @@ def build_online_region_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -425,7 +425,7 @@ def build_online_region_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -444,9 +444,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -464,7 +464,7 @@ def build_get_read_only_keys_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -481,9 +481,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -501,7 +501,7 @@ def build_list_read_only_keys_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -518,10 +518,10 @@ def build_regenerate_key_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( "template_url", @@ -537,7 +537,7 @@ def build_regenerate_key_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -552,9 +552,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) # Construct URL _url = kwargs.pop("template_url", "/providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}") path_format_arguments = { @@ -563,7 +563,7 @@ def build_check_name_exists_request(account_name: str, **kwargs: Any) -> HttpReq ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -577,9 +577,9 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -597,7 +597,7 @@ def build_list_metrics_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -615,9 +615,9 @@ def build_list_usages_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -635,7 +635,7 @@ def build_list_usages_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -654,9 +654,9 @@ def build_list_metric_definitions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -674,7 +674,7 @@ def build_list_metric_definitions_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -729,10 +729,10 @@ def get(self, resource_group_name: str, account_name: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountGetResults] + ) + cls: ClsType[_models.DatabaseAccountGetResults] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -744,9 +744,9 @@ def get(self, resource_group_name: str, account_name: str, **kwargs: Any) -> _mo params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -763,7 +763,9 @@ def get(self, resource_group_name: str, account_name: str, **kwargs: Any) -> _mo return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } def _update_initial( self, @@ -783,11 +785,11 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountGetResults] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseAccountGetResults] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -810,9 +812,9 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -829,7 +831,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } @overload def begin_update( @@ -940,16 +944,16 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseAccountGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + raw_result = self._update_initial( resource_group_name=resource_group_name, account_name=account_name, update_parameters=update_parameters, @@ -969,7 +973,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -981,9 +985,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } def _create_or_update_initial( self, @@ -1003,11 +1009,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountGetResults] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseAccountGetResults] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1030,9 +1036,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1049,7 +1055,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } @overload def begin_create_or_update( @@ -1167,16 +1175,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseAccountGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, account_name=account_name, create_update_parameters=create_update_parameters, @@ -1196,7 +1204,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1208,9 +1216,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, **kwargs: Any @@ -1226,10 +1236,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -1241,9 +1251,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1256,7 +1266,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } @distributed_trace def begin_delete(self, resource_group_name: str, account_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1282,13 +1294,13 @@ def begin_delete(self, resource_group_name: str, account_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -1306,7 +1318,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1318,9 +1330,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}" + } def _failover_priority_change_initial( # pylint: disable=inconsistent-return-statements self, @@ -1340,11 +1354,11 @@ def _failover_priority_change_initial( # pylint: disable=inconsistent-return-st _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1367,9 +1381,9 @@ def _failover_priority_change_initial( # pylint: disable=inconsistent-return-st params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1382,7 +1396,9 @@ def _failover_priority_change_initial( # pylint: disable=inconsistent-return-st if cls: return cls(pipeline_response, None, {}) - _failover_priority_change_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange"} # type: ignore + _failover_priority_change_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange" + } @overload def begin_failover_priority_change( @@ -1499,14 +1515,14 @@ def begin_failover_priority_change( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._failover_priority_change_initial( # type: ignore resource_group_name=resource_group_name, @@ -1526,7 +1542,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1538,9 +1554,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_failover_priority_change.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange"} # type: ignore + begin_failover_priority_change.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange" + } @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.DatabaseAccountGetResults"]: @@ -1555,10 +1573,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.DatabaseAccountGetResults"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountsListResult] + ) + cls: ClsType[_models.DatabaseAccountsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1579,7 +1597,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -1595,7 +1613,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1603,13 +1621,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseAccountsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1622,7 +1640,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts"} @distributed_trace def list_by_resource_group( @@ -1642,10 +1660,10 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountsListResult] + ) + cls: ClsType[_models.DatabaseAccountsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1667,7 +1685,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -1683,7 +1701,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1691,13 +1709,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DatabaseAccountsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1710,7 +1728,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts" + } @distributed_trace def list_keys( @@ -1739,10 +1759,10 @@ def list_keys( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountListKeysResult] + ) + cls: ClsType[_models.DatabaseAccountListKeysResult] = kwargs.pop("cls", None) request = build_list_keys_request( resource_group_name=resource_group_name, @@ -1754,9 +1774,9 @@ def list_keys( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1773,7 +1793,9 @@ def list_keys( return deserialized - list_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys"} # type: ignore + list_keys.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys" + } @distributed_trace def list_connection_strings( @@ -1802,10 +1824,10 @@ def list_connection_strings( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountListConnectionStringsResult] + ) + cls: ClsType[_models.DatabaseAccountListConnectionStringsResult] = kwargs.pop("cls", None) request = build_list_connection_strings_request( resource_group_name=resource_group_name, @@ -1817,9 +1839,9 @@ def list_connection_strings( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1836,7 +1858,9 @@ def list_connection_strings( return deserialized - list_connection_strings.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings"} # type: ignore + list_connection_strings.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings" + } def _offline_region_initial( # pylint: disable=inconsistent-return-statements self, @@ -1856,11 +1880,11 @@ def _offline_region_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1883,9 +1907,9 @@ def _offline_region_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1899,7 +1923,9 @@ def _offline_region_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _offline_region_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion"} # type: ignore + _offline_region_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion" + } @overload def begin_offline_region( @@ -2009,14 +2035,14 @@ def begin_offline_region( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._offline_region_initial( # type: ignore resource_group_name=resource_group_name, @@ -2036,7 +2062,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2048,9 +2074,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_offline_region.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion"} # type: ignore + begin_offline_region.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion" + } def _online_region_initial( # pylint: disable=inconsistent-return-statements self, @@ -2070,11 +2098,11 @@ def _online_region_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2097,9 +2125,9 @@ def _online_region_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2113,7 +2141,9 @@ def _online_region_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _online_region_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion"} # type: ignore + _online_region_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion" + } @overload def begin_online_region( @@ -2223,14 +2253,14 @@ def begin_online_region( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._online_region_initial( # type: ignore resource_group_name=resource_group_name, @@ -2250,7 +2280,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2262,9 +2292,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_online_region.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion"} # type: ignore + begin_online_region.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion" + } @distributed_trace def get_read_only_keys( @@ -2293,10 +2325,10 @@ def get_read_only_keys( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountListReadOnlyKeysResult] + ) + cls: ClsType[_models.DatabaseAccountListReadOnlyKeysResult] = kwargs.pop("cls", None) request = build_get_read_only_keys_request( resource_group_name=resource_group_name, @@ -2308,9 +2340,9 @@ def get_read_only_keys( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2327,7 +2359,9 @@ def get_read_only_keys( return deserialized - get_read_only_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys"} # type: ignore + get_read_only_keys.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys" + } @distributed_trace def list_read_only_keys( @@ -2356,10 +2390,10 @@ def list_read_only_keys( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAccountListReadOnlyKeysResult] + ) + cls: ClsType[_models.DatabaseAccountListReadOnlyKeysResult] = kwargs.pop("cls", None) request = build_list_read_only_keys_request( resource_group_name=resource_group_name, @@ -2371,9 +2405,9 @@ def list_read_only_keys( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2390,7 +2424,9 @@ def list_read_only_keys( return deserialized - list_read_only_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys"} # type: ignore + list_read_only_keys.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys" + } def _regenerate_key_initial( # pylint: disable=inconsistent-return-statements self, @@ -2410,11 +2446,11 @@ def _regenerate_key_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2437,9 +2473,9 @@ def _regenerate_key_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2452,7 +2488,9 @@ def _regenerate_key_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _regenerate_key_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey"} # type: ignore + _regenerate_key_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey" + } @overload def begin_regenerate_key( @@ -2561,14 +2599,14 @@ def begin_regenerate_key( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._regenerate_key_initial( # type: ignore resource_group_name=resource_group_name, @@ -2588,7 +2626,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2600,9 +2638,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_regenerate_key.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey"} # type: ignore + begin_regenerate_key.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey" + } @distributed_trace def check_name_exists(self, account_name: str, **kwargs: Any) -> bool: @@ -2628,10 +2668,10 @@ def check_name_exists(self, account_name: str, **kwargs: Any) -> bool: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_check_name_exists_request( account_name=account_name, @@ -2641,9 +2681,9 @@ def check_name_exists(self, account_name: str, **kwargs: Any) -> bool: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2657,7 +2697,7 @@ def check_name_exists(self, account_name: str, **kwargs: Any) -> bool: return cls(pipeline_response, None, {}) return 200 <= response.status_code <= 299 - check_name_exists.metadata = {"url": "/providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}"} # type: ignore + check_name_exists.metadata = {"url": "/providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}"} @distributed_trace def list_metrics( @@ -2682,10 +2722,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + ) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2709,7 +2749,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -2725,7 +2765,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2733,13 +2773,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("MetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2752,7 +2792,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics" + } @distributed_trace def list_usages( @@ -2777,10 +2819,10 @@ def list_usages( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.UsagesResult] + ) + cls: ClsType[_models.UsagesResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2804,7 +2846,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -2820,7 +2862,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2828,13 +2870,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("UsagesResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2847,7 +2889,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_usages.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages"} # type: ignore + list_usages.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages" + } @distributed_trace def list_metric_definitions( @@ -2868,10 +2912,10 @@ def list_metric_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricDefinitionsListResult] + ) + cls: ClsType[_models.MetricDefinitionsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2894,7 +2938,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -2910,7 +2954,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2918,13 +2962,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("MetricDefinitionsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2937,4 +2981,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metric_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions"} # type: ignore + list_metric_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions" + } 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 f8f8ec9050ea..05a2f00acf85 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 @@ -47,9 +47,9 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -68,7 +68,7 @@ def build_list_metrics_request( "databaseRid": _SERIALIZER.url("database_rid", database_rid, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -92,9 +92,9 @@ def build_list_usages_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,7 +113,7 @@ def build_list_usages_request( "databaseRid": _SERIALIZER.url("database_rid", database_rid, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -132,9 +132,9 @@ def build_list_metric_definitions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -153,7 +153,7 @@ def build_list_metric_definitions_request( "databaseRid": _SERIALIZER.url("database_rid", database_rid, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -209,10 +209,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + ) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -237,7 +237,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -253,7 +253,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -261,13 +261,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("MetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -280,7 +280,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metrics" + } @distributed_trace def list_usages( @@ -312,10 +314,10 @@ def list_usages( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.UsagesResult] + ) + cls: ClsType[_models.UsagesResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -340,7 +342,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -356,7 +358,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -364,13 +366,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("UsagesResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -383,7 +385,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_usages.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/usages"} # type: ignore + list_usages.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/usages" + } @distributed_trace def list_metric_definitions( @@ -406,10 +410,10 @@ def list_metric_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricDefinitionsListResult] + ) + cls: ClsType[_models.MetricDefinitionsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -433,7 +437,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -449,7 +453,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -457,13 +461,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("MetricDefinitionsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -476,4 +480,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metric_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metricDefinitions"} # type: ignore + list_metric_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metricDefinitions" + } 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 index 3ab016a9e089..b3df5feebc87 100644 --- 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 @@ -49,9 +49,9 @@ def build_list_graphs_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_graphs_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -86,9 +86,9 @@ def build_get_graph_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +107,7 @@ def build_get_graph_request( "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -124,10 +124,10 @@ def build_create_update_graph_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_create_update_graph_request( "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -164,9 +164,9 @@ def build_delete_graph_resource_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) # Construct URL _url = kwargs.pop( "template_url", @@ -183,7 +183,7 @@ def build_delete_graph_resource_request( "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -230,10 +230,10 @@ def list_graphs( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GraphResourcesListResult] + ) + cls: ClsType[_models.GraphResourcesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -256,7 +256,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -272,7 +272,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -280,13 +280,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -299,7 +299,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_graphs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs"} # type: ignore + list_graphs.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs" + } @distributed_trace def get_graph( @@ -331,10 +333,10 @@ def get_graph( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GraphResourceGetResults] + ) + cls: ClsType[_models.GraphResourceGetResults] = kwargs.pop("cls", None) request = build_get_graph_request( resource_group_name=resource_group_name, @@ -347,9 +349,9 @@ def get_graph( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -366,7 +368,9 @@ def get_graph( return deserialized - get_graph.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}"} # type: ignore + get_graph.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}" + } def _create_update_graph_initial( self, @@ -387,11 +391,11 @@ def _create_update_graph_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.GraphResourceGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.GraphResourceGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -415,9 +419,9 @@ def _create_update_graph_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -436,7 +440,9 @@ def _create_update_graph_initial( return deserialized - _create_update_graph_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}"} # type: ignore + _create_update_graph_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}" + } @overload def begin_create_update_graph( @@ -560,16 +566,16 @@ def begin_create_update_graph( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GraphResourceGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_graph_initial( # type: ignore + raw_result = self._create_update_graph_initial( resource_group_name=resource_group_name, account_name=account_name, graph_name=graph_name, @@ -590,7 +596,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -602,9 +608,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_graph.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}"} # type: ignore + begin_create_update_graph.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}" + } def _delete_graph_resource_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, graph_name: str, **kwargs: Any @@ -620,10 +628,10 @@ def _delete_graph_resource_initial( # pylint: disable=inconsistent-return-state _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_graph_resource_request( resource_group_name=resource_group_name, @@ -636,9 +644,9 @@ def _delete_graph_resource_initial( # pylint: disable=inconsistent-return-state params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -651,7 +659,9 @@ def _delete_graph_resource_initial( # pylint: disable=inconsistent-return-state if cls: return cls(pipeline_response, None, {}) - _delete_graph_resource_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}"} # type: ignore + _delete_graph_resource_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}" + } @distributed_trace def begin_delete_graph_resource( @@ -681,13 +691,13 @@ def begin_delete_graph_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_graph_resource_initial( # type: ignore resource_group_name=resource_group_name, @@ -706,7 +716,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -718,6 +728,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_graph_resource.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}"} # type: ignore + begin_delete_graph_resource.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}" + } 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 0c494fe1708a..6967eba7cd25 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 @@ -49,9 +49,9 @@ def build_list_gremlin_databases_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_gremlin_databases_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -86,9 +86,9 @@ def build_get_gremlin_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +107,7 @@ def build_get_gremlin_database_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -124,10 +124,10 @@ def build_create_update_gremlin_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_create_update_gremlin_database_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -164,9 +164,9 @@ def build_delete_gremlin_database_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) # Construct URL _url = kwargs.pop( "template_url", @@ -183,7 +183,7 @@ def build_delete_gremlin_database_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -197,9 +197,9 @@ def build_get_gremlin_database_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +218,7 @@ def build_get_gremlin_database_throughput_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -235,10 +235,10 @@ def build_update_gremlin_database_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -257,7 +257,7 @@ def build_update_gremlin_database_throughput_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -276,9 +276,9 @@ def build_migrate_gremlin_database_to_autoscale_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -297,7 +297,7 @@ def build_migrate_gremlin_database_to_autoscale_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -314,9 +314,9 @@ def build_migrate_gremlin_database_to_manual_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -335,7 +335,7 @@ def build_migrate_gremlin_database_to_manual_throughput_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -352,9 +352,9 @@ def build_list_gremlin_graphs_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -373,7 +373,7 @@ def build_list_gremlin_graphs_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -395,9 +395,9 @@ def build_get_gremlin_graph_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -417,7 +417,7 @@ def build_get_gremlin_graph_request( "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -439,10 +439,10 @@ def build_create_update_gremlin_graph_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -462,7 +462,7 @@ def build_create_update_gremlin_graph_request( "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -485,9 +485,9 @@ def build_delete_gremlin_graph_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) # Construct URL _url = kwargs.pop( "template_url", @@ -505,7 +505,7 @@ def build_delete_gremlin_graph_request( "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -524,9 +524,9 @@ def build_get_gremlin_graph_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -546,7 +546,7 @@ def build_get_gremlin_graph_throughput_request( "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -568,10 +568,10 @@ def build_update_gremlin_graph_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -591,7 +591,7 @@ def build_update_gremlin_graph_throughput_request( "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -615,9 +615,9 @@ def build_migrate_gremlin_graph_to_autoscale_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -637,7 +637,7 @@ def build_migrate_gremlin_graph_to_autoscale_request( "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -659,9 +659,9 @@ def build_migrate_gremlin_graph_to_manual_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -681,7 +681,7 @@ def build_migrate_gremlin_graph_to_manual_throughput_request( "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -703,10 +703,10 @@ def build_retrieve_continuous_backup_information_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -726,7 +726,7 @@ def build_retrieve_continuous_backup_information_request( "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -778,10 +778,10 @@ def list_gremlin_databases( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GremlinDatabaseListResult] + ) + cls: ClsType[_models.GremlinDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -804,7 +804,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -820,7 +820,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -828,13 +828,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("GremlinDatabaseListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -847,7 +847,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_gremlin_databases.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases"} # type: ignore + list_gremlin_databases.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases" + } @distributed_trace def get_gremlin_database( @@ -879,10 +881,10 @@ def get_gremlin_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GremlinDatabaseGetResults] + ) + cls: ClsType[_models.GremlinDatabaseGetResults] = kwargs.pop("cls", None) request = build_get_gremlin_database_request( resource_group_name=resource_group_name, @@ -895,9 +897,9 @@ def get_gremlin_database( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -914,7 +916,9 @@ def get_gremlin_database( return deserialized - get_gremlin_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}"} # type: ignore + get_gremlin_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}" + } def _create_update_gremlin_database_initial( self, @@ -935,11 +939,11 @@ def _create_update_gremlin_database_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.GremlinDatabaseGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.GremlinDatabaseGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -965,9 +969,9 @@ def _create_update_gremlin_database_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -986,7 +990,9 @@ def _create_update_gremlin_database_initial( return deserialized - _create_update_gremlin_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}"} # type: ignore + _create_update_gremlin_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}" + } @overload def begin_create_update_gremlin_database( @@ -1110,16 +1116,16 @@ def begin_create_update_gremlin_database( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GremlinDatabaseGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GremlinDatabaseGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_gremlin_database_initial( # type: ignore + raw_result = self._create_update_gremlin_database_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1140,7 +1146,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1152,9 +1158,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_gremlin_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}"} # type: ignore + begin_create_update_gremlin_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}" + } def _delete_gremlin_database_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -1170,10 +1178,10 @@ def _delete_gremlin_database_initial( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_gremlin_database_request( resource_group_name=resource_group_name, @@ -1186,9 +1194,9 @@ def _delete_gremlin_database_initial( # pylint: disable=inconsistent-return-sta params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1201,7 +1209,9 @@ def _delete_gremlin_database_initial( # pylint: disable=inconsistent-return-sta if cls: return cls(pipeline_response, None, {}) - _delete_gremlin_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}"} # type: ignore + _delete_gremlin_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}" + } @distributed_trace def begin_delete_gremlin_database( @@ -1231,13 +1241,13 @@ def begin_delete_gremlin_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_gremlin_database_initial( # type: ignore resource_group_name=resource_group_name, @@ -1256,7 +1266,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1268,9 +1278,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_gremlin_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}"} # type: ignore + begin_delete_gremlin_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}" + } @distributed_trace def get_gremlin_database_throughput( @@ -1302,10 +1314,10 @@ def get_gremlin_database_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_gremlin_database_throughput_request( resource_group_name=resource_group_name, @@ -1318,9 +1330,9 @@ def get_gremlin_database_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1337,7 +1349,9 @@ def get_gremlin_database_throughput( return deserialized - get_gremlin_database_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default"} # type: ignore + get_gremlin_database_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default" + } def _update_gremlin_database_throughput_initial( self, @@ -1358,11 +1372,11 @@ def _update_gremlin_database_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1386,9 +1400,9 @@ def _update_gremlin_database_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1407,7 +1421,9 @@ def _update_gremlin_database_throughput_initial( return deserialized - _update_gremlin_database_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default"} # type: ignore + _update_gremlin_database_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default" + } @overload def begin_update_gremlin_database_throughput( @@ -1531,16 +1547,16 @@ def begin_update_gremlin_database_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_gremlin_database_throughput_initial( # type: ignore + raw_result = self._update_gremlin_database_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1561,7 +1577,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1573,9 +1589,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_gremlin_database_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default"} # type: ignore + begin_update_gremlin_database_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default" + } def _migrate_gremlin_database_to_autoscale_initial( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -1591,10 +1609,10 @@ def _migrate_gremlin_database_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_gremlin_database_to_autoscale_request( resource_group_name=resource_group_name, @@ -1607,9 +1625,9 @@ def _migrate_gremlin_database_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1628,7 +1646,9 @@ def _migrate_gremlin_database_to_autoscale_initial( return deserialized - _migrate_gremlin_database_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_gremlin_database_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace def begin_migrate_gremlin_database_to_autoscale( @@ -1659,15 +1679,15 @@ def begin_migrate_gremlin_database_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_gremlin_database_to_autoscale_initial( # type: ignore + raw_result = self._migrate_gremlin_database_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1686,7 +1706,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1698,9 +1718,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_gremlin_database_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_gremlin_database_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale" + } def _migrate_gremlin_database_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -1716,10 +1738,10 @@ def _migrate_gremlin_database_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_gremlin_database_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -1732,9 +1754,9 @@ def _migrate_gremlin_database_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1753,7 +1775,9 @@ def _migrate_gremlin_database_to_manual_throughput_initial( return deserialized - _migrate_gremlin_database_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_gremlin_database_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def begin_migrate_gremlin_database_to_manual_throughput( @@ -1784,15 +1808,15 @@ def begin_migrate_gremlin_database_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_gremlin_database_to_manual_throughput_initial( # type: ignore + raw_result = self._migrate_gremlin_database_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1811,7 +1835,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1823,9 +1847,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_gremlin_database_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_gremlin_database_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def list_gremlin_graphs( @@ -1849,10 +1875,10 @@ def list_gremlin_graphs( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GremlinGraphListResult] + ) + cls: ClsType[_models.GremlinGraphListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1876,7 +1902,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -1892,7 +1918,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1900,13 +1926,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("GremlinGraphListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1919,7 +1945,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_gremlin_graphs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs"} # type: ignore + list_gremlin_graphs.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs" + } @distributed_trace def get_gremlin_graph( @@ -1952,10 +1980,10 @@ def get_gremlin_graph( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GremlinGraphGetResults] + ) + cls: ClsType[_models.GremlinGraphGetResults] = kwargs.pop("cls", None) request = build_get_gremlin_graph_request( resource_group_name=resource_group_name, @@ -1969,9 +1997,9 @@ def get_gremlin_graph( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1988,7 +2016,9 @@ def get_gremlin_graph( return deserialized - get_gremlin_graph.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}"} # type: ignore + get_gremlin_graph.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}" + } def _create_update_gremlin_graph_initial( self, @@ -2010,11 +2040,11 @@ def _create_update_gremlin_graph_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.GremlinGraphGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.GremlinGraphGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2039,9 +2069,9 @@ def _create_update_gremlin_graph_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2060,7 +2090,9 @@ def _create_update_gremlin_graph_initial( return deserialized - _create_update_gremlin_graph_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}"} # type: ignore + _create_update_gremlin_graph_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}" + } @overload def begin_create_update_gremlin_graph( @@ -2193,16 +2225,16 @@ def begin_create_update_gremlin_graph( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GremlinGraphGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GremlinGraphGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_gremlin_graph_initial( # type: ignore + raw_result = self._create_update_gremlin_graph_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2224,7 +2256,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2236,9 +2268,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_gremlin_graph.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}"} # type: ignore + begin_create_update_gremlin_graph.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}" + } def _delete_gremlin_graph_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, database_name: str, graph_name: str, **kwargs: Any @@ -2254,10 +2288,10 @@ def _delete_gremlin_graph_initial( # pylint: disable=inconsistent-return-statem _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_gremlin_graph_request( resource_group_name=resource_group_name, @@ -2271,9 +2305,9 @@ def _delete_gremlin_graph_initial( # pylint: disable=inconsistent-return-statem params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2286,7 +2320,9 @@ def _delete_gremlin_graph_initial( # pylint: disable=inconsistent-return-statem if cls: return cls(pipeline_response, None, {}) - _delete_gremlin_graph_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}"} # type: ignore + _delete_gremlin_graph_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}" + } @distributed_trace def begin_delete_gremlin_graph( @@ -2318,13 +2354,13 @@ def begin_delete_gremlin_graph( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_gremlin_graph_initial( # type: ignore resource_group_name=resource_group_name, @@ -2344,7 +2380,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2356,9 +2392,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_gremlin_graph.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}"} # type: ignore + begin_delete_gremlin_graph.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}" + } @distributed_trace def get_gremlin_graph_throughput( @@ -2392,10 +2430,10 @@ def get_gremlin_graph_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_gremlin_graph_throughput_request( resource_group_name=resource_group_name, @@ -2409,9 +2447,9 @@ def get_gremlin_graph_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2428,7 +2466,9 @@ def get_gremlin_graph_throughput( return deserialized - get_gremlin_graph_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default"} # type: ignore + get_gremlin_graph_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default" + } def _update_gremlin_graph_throughput_initial( self, @@ -2450,11 +2490,11 @@ def _update_gremlin_graph_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2479,9 +2519,9 @@ def _update_gremlin_graph_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2500,7 +2540,9 @@ def _update_gremlin_graph_throughput_initial( return deserialized - _update_gremlin_graph_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default"} # type: ignore + _update_gremlin_graph_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default" + } @overload def begin_update_gremlin_graph_throughput( @@ -2633,16 +2675,16 @@ def begin_update_gremlin_graph_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_gremlin_graph_throughput_initial( # type: ignore + raw_result = self._update_gremlin_graph_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2664,7 +2706,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2676,9 +2718,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_gremlin_graph_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default"} # type: ignore + begin_update_gremlin_graph_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default" + } def _migrate_gremlin_graph_to_autoscale_initial( self, resource_group_name: str, account_name: str, database_name: str, graph_name: str, **kwargs: Any @@ -2694,10 +2738,10 @@ def _migrate_gremlin_graph_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_gremlin_graph_to_autoscale_request( resource_group_name=resource_group_name, @@ -2711,9 +2755,9 @@ def _migrate_gremlin_graph_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2732,7 +2776,9 @@ def _migrate_gremlin_graph_to_autoscale_initial( return deserialized - _migrate_gremlin_graph_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_gremlin_graph_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace def begin_migrate_gremlin_graph_to_autoscale( @@ -2765,15 +2811,15 @@ def begin_migrate_gremlin_graph_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_gremlin_graph_to_autoscale_initial( # type: ignore + raw_result = self._migrate_gremlin_graph_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2793,7 +2839,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2805,9 +2851,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_gremlin_graph_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_gremlin_graph_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToAutoscale" + } def _migrate_gremlin_graph_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, graph_name: str, **kwargs: Any @@ -2823,10 +2871,10 @@ def _migrate_gremlin_graph_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_gremlin_graph_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -2840,9 +2888,9 @@ def _migrate_gremlin_graph_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2861,7 +2909,9 @@ def _migrate_gremlin_graph_to_manual_throughput_initial( return deserialized - _migrate_gremlin_graph_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_gremlin_graph_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def begin_migrate_gremlin_graph_to_manual_throughput( @@ -2894,15 +2944,15 @@ def begin_migrate_gremlin_graph_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_gremlin_graph_to_manual_throughput_initial( # type: ignore + raw_result = self._migrate_gremlin_graph_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2922,7 +2972,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2934,9 +2984,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_gremlin_graph_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_gremlin_graph_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToManualThroughput" + } def _retrieve_continuous_backup_information_initial( self, @@ -2958,11 +3010,11 @@ def _retrieve_continuous_backup_information_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.BackupInformation]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BackupInformation]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2987,9 +3039,9 @@ def _retrieve_continuous_backup_information_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3008,7 +3060,9 @@ def _retrieve_continuous_backup_information_initial( return deserialized - _retrieve_continuous_backup_information_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/retrieveContinuousBackupInformation"} # type: ignore + _retrieve_continuous_backup_information_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/retrieveContinuousBackupInformation" + } @overload def begin_retrieve_continuous_backup_information( @@ -3137,16 +3191,16 @@ def begin_retrieve_continuous_backup_information( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupInformation] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackupInformation] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._retrieve_continuous_backup_information_initial( # type: ignore + raw_result = self._retrieve_continuous_backup_information_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3168,9 +3222,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3182,6 +3236,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_retrieve_continuous_backup_information.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/retrieveContinuousBackupInformation"} # type: ignore + begin_retrieve_continuous_backup_information.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/retrieveContinuousBackupInformation" + } 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 6749f3590daa..74d105bd6cd2 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 @@ -45,9 +45,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -56,7 +56,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -71,9 +71,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +85,7 @@ def build_get_request(location: str, subscription_id: str, **kwargs: Any) -> Htt "location": _SERIALIZER.url("location", location, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -127,10 +127,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.LocationGetResult"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LocationListResult] + ) + cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -151,7 +151,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -167,7 +167,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -175,13 +175,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("LocationListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -194,7 +194,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations"} @distributed_trace def get(self, location: str, **kwargs: Any) -> _models.LocationGetResult: @@ -219,10 +219,10 @@ def get(self, location: str, **kwargs: Any) -> _models.LocationGetResult: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LocationGetResult] + ) + cls: ClsType[_models.LocationGetResult] = kwargs.pop("cls", None) request = build_get_request( location=location, @@ -233,9 +233,9 @@ def get(self, location: str, **kwargs: Any) -> _models.LocationGetResult: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -252,4 +252,4 @@ def get(self, location: str, **kwargs: Any) -> _models.LocationGetResult: return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}"} 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 311c5218fa83..ada08b3ebd20 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 @@ -49,9 +49,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_mongo_db_databases_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -86,9 +86,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +107,7 @@ def build_get_mongo_db_database_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -124,10 +124,10 @@ def build_create_update_mongo_db_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_create_update_mongo_db_database_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -164,9 +164,9 @@ def build_delete_mongo_db_database_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) # Construct URL _url = kwargs.pop( "template_url", @@ -183,7 +183,7 @@ def build_delete_mongo_db_database_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -197,9 +197,9 @@ def build_get_mongo_db_database_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +218,7 @@ def build_get_mongo_db_database_throughput_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -235,10 +235,10 @@ def build_update_mongo_db_database_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -257,7 +257,7 @@ def build_update_mongo_db_database_throughput_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -276,9 +276,9 @@ def build_migrate_mongo_db_database_to_autoscale_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -297,7 +297,7 @@ def build_migrate_mongo_db_database_to_autoscale_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -314,9 +314,9 @@ def build_migrate_mongo_db_database_to_manual_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -335,7 +335,7 @@ def build_migrate_mongo_db_database_to_manual_throughput_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -352,10 +352,10 @@ def build_mongo_db_database_retrieve_throughput_distribution_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -374,7 +374,7 @@ def build_mongo_db_database_retrieve_throughput_distribution_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -393,10 +393,10 @@ def build_mongo_db_database_redistribute_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -415,7 +415,7 @@ def build_mongo_db_database_redistribute_throughput_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -439,10 +439,10 @@ def build_mongo_db_container_retrieve_throughput_distribution_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -462,7 +462,7 @@ def build_mongo_db_container_retrieve_throughput_distribution_request( "collectionName": _SERIALIZER.url("collection_name", collection_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -486,10 +486,10 @@ def build_mongo_db_container_redistribute_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -509,7 +509,7 @@ def build_mongo_db_container_redistribute_throughput_request( "collectionName": _SERIALIZER.url("collection_name", collection_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -528,9 +528,9 @@ def build_list_mongo_db_collections_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -549,7 +549,7 @@ def build_list_mongo_db_collections_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -571,9 +571,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -593,7 +593,7 @@ def build_get_mongo_db_collection_request( "collectionName": _SERIALIZER.url("collection_name", collection_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -615,10 +615,10 @@ def build_create_update_mongo_db_collection_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -638,7 +638,7 @@ def build_create_update_mongo_db_collection_request( "collectionName": _SERIALIZER.url("collection_name", collection_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -661,9 +661,9 @@ def build_delete_mongo_db_collection_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) # Construct URL _url = kwargs.pop( "template_url", @@ -681,7 +681,7 @@ def build_delete_mongo_db_collection_request( "collectionName": _SERIALIZER.url("collection_name", collection_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -700,10 +700,10 @@ def build_list_mongo_db_collection_partition_merge_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -723,7 +723,7 @@ def build_list_mongo_db_collection_partition_merge_request( "collectionName": _SERIALIZER.url("collection_name", collection_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -747,9 +747,9 @@ def build_get_mongo_db_collection_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -769,7 +769,7 @@ def build_get_mongo_db_collection_throughput_request( "collectionName": _SERIALIZER.url("collection_name", collection_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -791,10 +791,10 @@ def build_update_mongo_db_collection_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -814,7 +814,7 @@ def build_update_mongo_db_collection_throughput_request( "collectionName": _SERIALIZER.url("collection_name", collection_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -838,9 +838,9 @@ def build_migrate_mongo_db_collection_to_autoscale_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -860,7 +860,7 @@ def build_migrate_mongo_db_collection_to_autoscale_request( "collectionName": _SERIALIZER.url("collection_name", collection_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -882,9 +882,9 @@ def build_migrate_mongo_db_collection_to_manual_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -904,7 +904,7 @@ def build_migrate_mongo_db_collection_to_manual_throughput_request( "collectionName": _SERIALIZER.url("collection_name", collection_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -921,9 +921,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -942,7 +942,7 @@ def build_get_mongo_role_definition_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -959,10 +959,10 @@ def build_create_update_mongo_role_definition_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -981,7 +981,7 @@ def build_create_update_mongo_role_definition_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1000,9 +1000,9 @@ def build_delete_mongo_role_definition_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1021,7 +1021,7 @@ def build_delete_mongo_role_definition_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1038,9 +1038,9 @@ def build_list_mongo_role_definitions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1058,7 +1058,7 @@ def build_list_mongo_role_definitions_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1075,9 +1075,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1096,7 +1096,7 @@ def build_get_mongo_user_definition_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1113,10 +1113,10 @@ def build_create_update_mongo_user_definition_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1135,7 +1135,7 @@ def build_create_update_mongo_user_definition_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1154,9 +1154,9 @@ def build_delete_mongo_user_definition_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1175,7 +1175,7 @@ def build_delete_mongo_user_definition_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1192,9 +1192,9 @@ def build_list_mongo_user_definitions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1212,7 +1212,7 @@ def build_list_mongo_user_definitions_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1234,10 +1234,10 @@ def build_retrieve_continuous_backup_information_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1257,7 +1257,7 @@ def build_retrieve_continuous_backup_information_request( "collectionName": _SERIALIZER.url("collection_name", collection_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1309,10 +1309,10 @@ def list_mongo_db_databases( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoDBDatabaseListResult] + ) + cls: ClsType[_models.MongoDBDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1335,7 +1335,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -1351,7 +1351,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1359,13 +1359,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("MongoDBDatabaseListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1378,7 +1378,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_mongo_db_databases.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases"} # type: ignore + list_mongo_db_databases.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases" + } @distributed_trace def get_mongo_db_database( @@ -1410,10 +1412,10 @@ def get_mongo_db_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoDBDatabaseGetResults] + ) + cls: ClsType[_models.MongoDBDatabaseGetResults] = kwargs.pop("cls", None) request = build_get_mongo_db_database_request( resource_group_name=resource_group_name, @@ -1426,9 +1428,9 @@ def get_mongo_db_database( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1445,7 +1447,9 @@ def get_mongo_db_database( return deserialized - get_mongo_db_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}"} # type: ignore + get_mongo_db_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}" + } def _create_update_mongo_db_database_initial( self, @@ -1466,11 +1470,11 @@ def _create_update_mongo_db_database_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.MongoDBDatabaseGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.MongoDBDatabaseGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1496,9 +1500,9 @@ def _create_update_mongo_db_database_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1517,7 +1521,9 @@ def _create_update_mongo_db_database_initial( return deserialized - _create_update_mongo_db_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}"} # type: ignore + _create_update_mongo_db_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}" + } @overload def begin_create_update_mongo_db_database( @@ -1641,16 +1647,16 @@ def begin_create_update_mongo_db_database( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoDBDatabaseGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MongoDBDatabaseGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_mongo_db_database_initial( # type: ignore + raw_result = self._create_update_mongo_db_database_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1671,7 +1677,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1683,9 +1689,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_mongo_db_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}"} # type: ignore + begin_create_update_mongo_db_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}" + } def _delete_mongo_db_database_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -1701,10 +1709,10 @@ def _delete_mongo_db_database_initial( # pylint: disable=inconsistent-return-st _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_mongo_db_database_request( resource_group_name=resource_group_name, @@ -1717,9 +1725,9 @@ def _delete_mongo_db_database_initial( # pylint: disable=inconsistent-return-st params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1732,7 +1740,9 @@ def _delete_mongo_db_database_initial( # pylint: disable=inconsistent-return-st if cls: return cls(pipeline_response, None, {}) - _delete_mongo_db_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}"} # type: ignore + _delete_mongo_db_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}" + } @distributed_trace def begin_delete_mongo_db_database( @@ -1762,13 +1772,13 @@ def begin_delete_mongo_db_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_mongo_db_database_initial( # type: ignore resource_group_name=resource_group_name, @@ -1787,7 +1797,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1799,9 +1809,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_mongo_db_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}"} # type: ignore + begin_delete_mongo_db_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}" + } @distributed_trace def get_mongo_db_database_throughput( @@ -1833,10 +1845,10 @@ def get_mongo_db_database_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_mongo_db_database_throughput_request( resource_group_name=resource_group_name, @@ -1849,9 +1861,9 @@ def get_mongo_db_database_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1868,7 +1880,9 @@ def get_mongo_db_database_throughput( return deserialized - get_mongo_db_database_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default"} # type: ignore + get_mongo_db_database_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default" + } def _update_mongo_db_database_throughput_initial( self, @@ -1889,11 +1903,11 @@ def _update_mongo_db_database_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1917,9 +1931,9 @@ def _update_mongo_db_database_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1938,7 +1952,9 @@ def _update_mongo_db_database_throughput_initial( return deserialized - _update_mongo_db_database_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default"} # type: ignore + _update_mongo_db_database_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default" + } @overload def begin_update_mongo_db_database_throughput( @@ -2062,16 +2078,16 @@ def begin_update_mongo_db_database_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_mongo_db_database_throughput_initial( # type: ignore + raw_result = self._update_mongo_db_database_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2092,7 +2108,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2104,9 +2120,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_mongo_db_database_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default"} # type: ignore + begin_update_mongo_db_database_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default" + } def _migrate_mongo_db_database_to_autoscale_initial( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -2122,10 +2140,10 @@ def _migrate_mongo_db_database_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_mongo_db_database_to_autoscale_request( resource_group_name=resource_group_name, @@ -2138,9 +2156,9 @@ def _migrate_mongo_db_database_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2159,7 +2177,9 @@ def _migrate_mongo_db_database_to_autoscale_initial( return deserialized - _migrate_mongo_db_database_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_mongo_db_database_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace def begin_migrate_mongo_db_database_to_autoscale( @@ -2190,15 +2210,15 @@ def begin_migrate_mongo_db_database_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_mongo_db_database_to_autoscale_initial( # type: ignore + raw_result = self._migrate_mongo_db_database_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2217,7 +2237,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2229,9 +2249,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_mongo_db_database_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_mongo_db_database_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale" + } def _migrate_mongo_db_database_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -2247,10 +2269,10 @@ def _migrate_mongo_db_database_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_mongo_db_database_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -2263,9 +2285,9 @@ def _migrate_mongo_db_database_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2284,7 +2306,9 @@ def _migrate_mongo_db_database_to_manual_throughput_initial( return deserialized - _migrate_mongo_db_database_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_mongo_db_database_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def begin_migrate_mongo_db_database_to_manual_throughput( @@ -2315,15 +2339,15 @@ def begin_migrate_mongo_db_database_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_mongo_db_database_to_manual_throughput_initial( # type: ignore + raw_result = self._migrate_mongo_db_database_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2342,7 +2366,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2354,9 +2378,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_mongo_db_database_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_mongo_db_database_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput" + } def _mongo_db_database_retrieve_throughput_distribution_initial( self, @@ -2377,11 +2403,11 @@ def _mongo_db_database_retrieve_throughput_distribution_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2405,9 +2431,9 @@ def _mongo_db_database_retrieve_throughput_distribution_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2426,7 +2452,9 @@ def _mongo_db_database_retrieve_throughput_distribution_initial( return deserialized - _mongo_db_database_retrieve_throughput_distribution_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + _mongo_db_database_retrieve_throughput_distribution_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution" + } @overload def begin_mongo_db_database_retrieve_throughput_distribution( @@ -2552,16 +2580,16 @@ def begin_mongo_db_database_retrieve_throughput_distribution( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._mongo_db_database_retrieve_throughput_distribution_initial( # type: ignore + raw_result = self._mongo_db_database_retrieve_throughput_distribution_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2582,9 +2610,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2596,9 +2624,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_mongo_db_database_retrieve_throughput_distribution.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + begin_mongo_db_database_retrieve_throughput_distribution.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution" + } def _mongo_db_database_redistribute_throughput_initial( self, @@ -2619,11 +2649,11 @@ def _mongo_db_database_redistribute_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2647,9 +2677,9 @@ def _mongo_db_database_redistribute_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2668,7 +2698,9 @@ def _mongo_db_database_redistribute_throughput_initial( return deserialized - _mongo_db_database_redistribute_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/redistributeThroughput"} # type: ignore + _mongo_db_database_redistribute_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/redistributeThroughput" + } @overload def begin_mongo_db_database_redistribute_throughput( @@ -2795,16 +2827,16 @@ def begin_mongo_db_database_redistribute_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._mongo_db_database_redistribute_throughput_initial( # type: ignore + raw_result = self._mongo_db_database_redistribute_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2825,9 +2857,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2839,9 +2871,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_mongo_db_database_redistribute_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/redistributeThroughput"} # type: ignore + begin_mongo_db_database_redistribute_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/redistributeThroughput" + } def _mongo_db_container_retrieve_throughput_distribution_initial( self, @@ -2863,11 +2897,11 @@ def _mongo_db_container_retrieve_throughput_distribution_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2892,9 +2926,9 @@ def _mongo_db_container_retrieve_throughput_distribution_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2913,7 +2947,9 @@ def _mongo_db_container_retrieve_throughput_distribution_initial( return deserialized - _mongo_db_container_retrieve_throughput_distribution_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + _mongo_db_container_retrieve_throughput_distribution_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution" + } @overload def begin_mongo_db_container_retrieve_throughput_distribution( @@ -3048,16 +3084,16 @@ def begin_mongo_db_container_retrieve_throughput_distribution( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._mongo_db_container_retrieve_throughput_distribution_initial( # type: ignore + raw_result = self._mongo_db_container_retrieve_throughput_distribution_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3079,9 +3115,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3093,9 +3129,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_mongo_db_container_retrieve_throughput_distribution.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + begin_mongo_db_container_retrieve_throughput_distribution.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution" + } def _mongo_db_container_redistribute_throughput_initial( self, @@ -3117,11 +3155,11 @@ def _mongo_db_container_redistribute_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -3146,9 +3184,9 @@ def _mongo_db_container_redistribute_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3167,7 +3205,9 @@ def _mongo_db_container_redistribute_throughput_initial( return deserialized - _mongo_db_container_redistribute_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput"} # type: ignore + _mongo_db_container_redistribute_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput" + } @overload def begin_mongo_db_container_redistribute_throughput( @@ -3303,16 +3343,16 @@ def begin_mongo_db_container_redistribute_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._mongo_db_container_redistribute_throughput_initial( # type: ignore + raw_result = self._mongo_db_container_redistribute_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3334,9 +3374,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3348,9 +3388,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_mongo_db_container_redistribute_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput"} # type: ignore + begin_mongo_db_container_redistribute_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput" + } @distributed_trace def list_mongo_db_collections( @@ -3374,10 +3416,10 @@ def list_mongo_db_collections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoDBCollectionListResult] + ) + cls: ClsType[_models.MongoDBCollectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -3401,7 +3443,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -3417,7 +3459,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -3425,13 +3467,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -3444,7 +3486,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_mongo_db_collections.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections"} # type: ignore + list_mongo_db_collections.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections" + } @distributed_trace def get_mongo_db_collection( @@ -3477,10 +3521,10 @@ def get_mongo_db_collection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoDBCollectionGetResults] + ) + cls: ClsType[_models.MongoDBCollectionGetResults] = kwargs.pop("cls", None) request = build_get_mongo_db_collection_request( resource_group_name=resource_group_name, @@ -3494,9 +3538,9 @@ def get_mongo_db_collection( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3513,7 +3557,9 @@ def get_mongo_db_collection( return deserialized - get_mongo_db_collection.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}"} # type: ignore + get_mongo_db_collection.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}" + } def _create_update_mongo_db_collection_initial( self, @@ -3535,11 +3581,11 @@ def _create_update_mongo_db_collection_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.MongoDBCollectionGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.MongoDBCollectionGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -3566,9 +3612,9 @@ def _create_update_mongo_db_collection_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3587,7 +3633,9 @@ def _create_update_mongo_db_collection_initial( return deserialized - _create_update_mongo_db_collection_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}"} # type: ignore + _create_update_mongo_db_collection_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}" + } @overload def begin_create_update_mongo_db_collection( @@ -3720,16 +3768,16 @@ def begin_create_update_mongo_db_collection( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoDBCollectionGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_mongo_db_collection_initial( # type: ignore + raw_result = self._create_update_mongo_db_collection_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3751,7 +3799,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3763,9 +3811,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_mongo_db_collection.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}"} # type: ignore + begin_create_update_mongo_db_collection.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}" + } def _delete_mongo_db_collection_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any @@ -3781,10 +3831,10 @@ def _delete_mongo_db_collection_initial( # pylint: disable=inconsistent-return- _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_mongo_db_collection_request( resource_group_name=resource_group_name, @@ -3798,9 +3848,9 @@ def _delete_mongo_db_collection_initial( # pylint: disable=inconsistent-return- params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3813,7 +3863,9 @@ def _delete_mongo_db_collection_initial( # pylint: disable=inconsistent-return- if cls: return cls(pipeline_response, None, {}) - _delete_mongo_db_collection_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}"} # type: ignore + _delete_mongo_db_collection_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}" + } @distributed_trace def begin_delete_mongo_db_collection( @@ -3845,13 +3897,13 @@ def begin_delete_mongo_db_collection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_mongo_db_collection_initial( # type: ignore resource_group_name=resource_group_name, @@ -3871,7 +3923,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3883,9 +3935,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_mongo_db_collection.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}"} # type: ignore + begin_delete_mongo_db_collection.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}" + } def _list_mongo_db_collection_partition_merge_initial( self, @@ -3907,11 +3961,11 @@ def _list_mongo_db_collection_partition_merge_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionStorageInfoCollection]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionStorageInfoCollection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -3936,9 +3990,9 @@ def _list_mongo_db_collection_partition_merge_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3957,7 +4011,9 @@ def _list_mongo_db_collection_partition_merge_initial( return deserialized - _list_mongo_db_collection_partition_merge_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge"} # type: ignore + _list_mongo_db_collection_partition_merge_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge" + } @overload def begin_list_mongo_db_collection_partition_merge( @@ -4089,16 +4145,16 @@ def begin_list_mongo_db_collection_partition_merge( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionStorageInfoCollection] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._list_mongo_db_collection_partition_merge_initial( # type: ignore + raw_result = self._list_mongo_db_collection_partition_merge_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -4120,9 +4176,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -4134,9 +4190,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_list_mongo_db_collection_partition_merge.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge"} # type: ignore + begin_list_mongo_db_collection_partition_merge.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge" + } @distributed_trace def get_mongo_db_collection_throughput( @@ -4170,10 +4228,10 @@ def get_mongo_db_collection_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_mongo_db_collection_throughput_request( resource_group_name=resource_group_name, @@ -4187,9 +4245,9 @@ def get_mongo_db_collection_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4206,7 +4264,9 @@ def get_mongo_db_collection_throughput( return deserialized - get_mongo_db_collection_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default"} # type: ignore + get_mongo_db_collection_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default" + } def _update_mongo_db_collection_throughput_initial( self, @@ -4228,11 +4288,11 @@ def _update_mongo_db_collection_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -4257,9 +4317,9 @@ def _update_mongo_db_collection_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4278,7 +4338,9 @@ def _update_mongo_db_collection_throughput_initial( return deserialized - _update_mongo_db_collection_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default"} # type: ignore + _update_mongo_db_collection_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default" + } @overload def begin_update_mongo_db_collection_throughput( @@ -4411,16 +4473,16 @@ def begin_update_mongo_db_collection_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_mongo_db_collection_throughput_initial( # type: ignore + raw_result = self._update_mongo_db_collection_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -4442,7 +4504,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -4454,9 +4516,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_mongo_db_collection_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default"} # type: ignore + begin_update_mongo_db_collection_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default" + } def _migrate_mongo_db_collection_to_autoscale_initial( self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any @@ -4472,10 +4536,10 @@ def _migrate_mongo_db_collection_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_mongo_db_collection_to_autoscale_request( resource_group_name=resource_group_name, @@ -4489,9 +4553,9 @@ def _migrate_mongo_db_collection_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4510,7 +4574,9 @@ def _migrate_mongo_db_collection_to_autoscale_initial( return deserialized - _migrate_mongo_db_collection_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_mongo_db_collection_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace def begin_migrate_mongo_db_collection_to_autoscale( @@ -4543,15 +4609,15 @@ def begin_migrate_mongo_db_collection_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_mongo_db_collection_to_autoscale_initial( # type: ignore + raw_result = self._migrate_mongo_db_collection_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -4571,7 +4637,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -4583,9 +4649,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_mongo_db_collection_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_mongo_db_collection_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToAutoscale" + } def _migrate_mongo_db_collection_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any @@ -4601,10 +4669,10 @@ def _migrate_mongo_db_collection_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_mongo_db_collection_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -4618,9 +4686,9 @@ def _migrate_mongo_db_collection_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4639,7 +4707,9 @@ def _migrate_mongo_db_collection_to_manual_throughput_initial( return deserialized - _migrate_mongo_db_collection_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_mongo_db_collection_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def begin_migrate_mongo_db_collection_to_manual_throughput( @@ -4672,15 +4742,15 @@ def begin_migrate_mongo_db_collection_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_mongo_db_collection_to_manual_throughput_initial( # type: ignore + raw_result = self._migrate_mongo_db_collection_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -4700,7 +4770,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -4712,9 +4782,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_mongo_db_collection_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_mongo_db_collection_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def get_mongo_role_definition( @@ -4746,10 +4818,10 @@ def get_mongo_role_definition( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoRoleDefinitionGetResults] + ) + cls: ClsType[_models.MongoRoleDefinitionGetResults] = kwargs.pop("cls", None) request = build_get_mongo_role_definition_request( mongo_role_definition_id=mongo_role_definition_id, @@ -4762,9 +4834,9 @@ def get_mongo_role_definition( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4781,7 +4853,9 @@ def get_mongo_role_definition( return deserialized - get_mongo_role_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}"} # type: ignore + get_mongo_role_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}" + } def _create_update_mongo_role_definition_initial( self, @@ -4802,11 +4876,11 @@ def _create_update_mongo_role_definition_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.MongoRoleDefinitionGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.MongoRoleDefinitionGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -4832,9 +4906,9 @@ def _create_update_mongo_role_definition_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4853,7 +4927,9 @@ def _create_update_mongo_role_definition_initial( return deserialized - _create_update_mongo_role_definition_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}"} # type: ignore + _create_update_mongo_role_definition_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}" + } @overload def begin_create_update_mongo_role_definition( @@ -4980,16 +5056,16 @@ def begin_create_update_mongo_role_definition( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoRoleDefinitionGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MongoRoleDefinitionGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_mongo_role_definition_initial( # type: ignore + raw_result = self._create_update_mongo_role_definition_initial( mongo_role_definition_id=mongo_role_definition_id, resource_group_name=resource_group_name, account_name=account_name, @@ -5010,7 +5086,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -5022,9 +5098,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_mongo_role_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}"} # type: ignore + begin_create_update_mongo_role_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}" + } def _delete_mongo_role_definition_initial( # pylint: disable=inconsistent-return-statements self, mongo_role_definition_id: str, resource_group_name: str, account_name: str, **kwargs: Any @@ -5040,10 +5118,10 @@ def _delete_mongo_role_definition_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_mongo_role_definition_request( mongo_role_definition_id=mongo_role_definition_id, @@ -5056,9 +5134,9 @@ def _delete_mongo_role_definition_initial( # pylint: disable=inconsistent-retur params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5071,7 +5149,9 @@ def _delete_mongo_role_definition_initial( # pylint: disable=inconsistent-retur if cls: return cls(pipeline_response, None, {}) - _delete_mongo_role_definition_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}"} # type: ignore + _delete_mongo_role_definition_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}" + } @distributed_trace def begin_delete_mongo_role_definition( @@ -5101,13 +5181,13 @@ def begin_delete_mongo_role_definition( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_mongo_role_definition_initial( # type: ignore mongo_role_definition_id=mongo_role_definition_id, @@ -5126,7 +5206,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -5138,9 +5218,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_mongo_role_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}"} # type: ignore + begin_delete_mongo_role_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}" + } @distributed_trace def list_mongo_role_definitions( @@ -5162,10 +5244,10 @@ def list_mongo_role_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoRoleDefinitionListResult] + ) + cls: ClsType[_models.MongoRoleDefinitionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -5188,7 +5270,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -5204,7 +5286,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -5212,13 +5294,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("MongoRoleDefinitionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -5231,7 +5313,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_mongo_role_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions"} # type: ignore + list_mongo_role_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions" + } @distributed_trace def get_mongo_user_definition( @@ -5263,10 +5347,10 @@ def get_mongo_user_definition( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoUserDefinitionGetResults] + ) + cls: ClsType[_models.MongoUserDefinitionGetResults] = kwargs.pop("cls", None) request = build_get_mongo_user_definition_request( mongo_user_definition_id=mongo_user_definition_id, @@ -5279,9 +5363,9 @@ def get_mongo_user_definition( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5298,7 +5382,9 @@ def get_mongo_user_definition( return deserialized - get_mongo_user_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}"} # type: ignore + get_mongo_user_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}" + } def _create_update_mongo_user_definition_initial( self, @@ -5319,11 +5405,11 @@ def _create_update_mongo_user_definition_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.MongoUserDefinitionGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.MongoUserDefinitionGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -5349,9 +5435,9 @@ def _create_update_mongo_user_definition_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5370,7 +5456,9 @@ def _create_update_mongo_user_definition_initial( return deserialized - _create_update_mongo_user_definition_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}"} # type: ignore + _create_update_mongo_user_definition_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}" + } @overload def begin_create_update_mongo_user_definition( @@ -5497,16 +5585,16 @@ def begin_create_update_mongo_user_definition( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoUserDefinitionGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MongoUserDefinitionGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_mongo_user_definition_initial( # type: ignore + raw_result = self._create_update_mongo_user_definition_initial( mongo_user_definition_id=mongo_user_definition_id, resource_group_name=resource_group_name, account_name=account_name, @@ -5527,7 +5615,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -5539,9 +5627,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_mongo_user_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}"} # type: ignore + begin_create_update_mongo_user_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}" + } def _delete_mongo_user_definition_initial( # pylint: disable=inconsistent-return-statements self, mongo_user_definition_id: str, resource_group_name: str, account_name: str, **kwargs: Any @@ -5557,10 +5647,10 @@ def _delete_mongo_user_definition_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_mongo_user_definition_request( mongo_user_definition_id=mongo_user_definition_id, @@ -5573,9 +5663,9 @@ def _delete_mongo_user_definition_initial( # pylint: disable=inconsistent-retur params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5588,7 +5678,9 @@ def _delete_mongo_user_definition_initial( # pylint: disable=inconsistent-retur if cls: return cls(pipeline_response, None, {}) - _delete_mongo_user_definition_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}"} # type: ignore + _delete_mongo_user_definition_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}" + } @distributed_trace def begin_delete_mongo_user_definition( @@ -5618,13 +5710,13 @@ def begin_delete_mongo_user_definition( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_mongo_user_definition_initial( # type: ignore mongo_user_definition_id=mongo_user_definition_id, @@ -5643,7 +5735,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -5655,9 +5747,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_mongo_user_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}"} # type: ignore + begin_delete_mongo_user_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}" + } @distributed_trace def list_mongo_user_definitions( @@ -5679,10 +5773,10 @@ def list_mongo_user_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MongoUserDefinitionListResult] + ) + cls: ClsType[_models.MongoUserDefinitionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -5705,7 +5799,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -5721,7 +5815,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -5729,13 +5823,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("MongoUserDefinitionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -5748,7 +5842,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_mongo_user_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions"} # type: ignore + list_mongo_user_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions" + } def _retrieve_continuous_backup_information_initial( self, @@ -5770,11 +5866,11 @@ def _retrieve_continuous_backup_information_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.BackupInformation]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BackupInformation]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -5799,9 +5895,9 @@ def _retrieve_continuous_backup_information_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5820,7 +5916,9 @@ def _retrieve_continuous_backup_information_initial( return deserialized - _retrieve_continuous_backup_information_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/retrieveContinuousBackupInformation"} # type: ignore + _retrieve_continuous_backup_information_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/retrieveContinuousBackupInformation" + } @overload def begin_retrieve_continuous_backup_information( @@ -5949,16 +6047,16 @@ def begin_retrieve_continuous_backup_information( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupInformation] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackupInformation] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._retrieve_continuous_backup_information_initial( # type: ignore + raw_result = self._retrieve_continuous_backup_information_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -5980,9 +6078,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -5994,6 +6092,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_retrieve_continuous_backup_information.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/retrieveContinuousBackupInformation"} # type: ignore + begin_retrieve_continuous_backup_information.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/retrieveContinuousBackupInformation" + } 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 93f6c5e537aa..0e18903a304a 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 @@ -49,9 +49,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_by_database_account_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -90,9 +90,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +111,7 @@ def build_get_request( "notebookWorkspaceName": _SERIALIZER.url("notebook_workspace_name", notebook_workspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -132,10 +132,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -154,7 +154,7 @@ def build_create_or_update_request( "notebookWorkspaceName": _SERIALIZER.url("notebook_workspace_name", notebook_workspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -177,9 +177,9 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +198,7 @@ def build_delete_request( "notebookWorkspaceName": _SERIALIZER.url("notebook_workspace_name", notebook_workspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -219,9 +219,9 @@ def build_list_connection_info_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -240,7 +240,7 @@ def build_list_connection_info_request( "notebookWorkspaceName": _SERIALIZER.url("notebook_workspace_name", notebook_workspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -261,9 +261,9 @@ def build_regenerate_auth_token_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -282,7 +282,7 @@ def build_regenerate_auth_token_request( "notebookWorkspaceName": _SERIALIZER.url("notebook_workspace_name", notebook_workspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -303,9 +303,9 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -324,7 +324,7 @@ def build_start_request( "notebookWorkspaceName": _SERIALIZER.url("notebook_workspace_name", notebook_workspace_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -373,10 +373,10 @@ def list_by_database_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NotebookWorkspaceListResult] + ) + cls: ClsType[_models.NotebookWorkspaceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -399,7 +399,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -415,7 +415,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -423,13 +423,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("NotebookWorkspaceListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -443,7 +443,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database_account.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces"} # type: ignore + list_by_database_account.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces" + } @distributed_trace def get( @@ -479,10 +481,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NotebookWorkspace] + ) + cls: ClsType[_models.NotebookWorkspace] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -495,9 +497,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -515,7 +517,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}" + } def _create_or_update_initial( self, @@ -536,11 +540,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NotebookWorkspace] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NotebookWorkspace] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -564,9 +568,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -584,7 +588,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}" + } @overload def begin_create_or_update( @@ -711,16 +717,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NotebookWorkspace] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NotebookWorkspace] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, account_name=account_name, notebook_workspace_name=notebook_workspace_name, @@ -741,7 +747,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -753,9 +759,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -775,10 +783,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -791,9 +799,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -807,7 +815,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}" + } @distributed_trace def begin_delete( @@ -842,13 +852,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -867,7 +877,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -879,9 +889,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}" + } @distributed_trace def list_connection_info( @@ -917,10 +929,10 @@ def list_connection_info( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NotebookWorkspaceConnectionInfoResult] + ) + cls: ClsType[_models.NotebookWorkspaceConnectionInfoResult] = kwargs.pop("cls", None) request = build_list_connection_info_request( resource_group_name=resource_group_name, @@ -933,9 +945,9 @@ def list_connection_info( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -953,7 +965,9 @@ def list_connection_info( return deserialized - list_connection_info.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/listConnectionInfo"} # type: ignore + list_connection_info.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/listConnectionInfo" + } def _regenerate_auth_token_initial( # pylint: disable=inconsistent-return-statements self, @@ -973,10 +987,10 @@ def _regenerate_auth_token_initial( # pylint: disable=inconsistent-return-state _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_regenerate_auth_token_request( resource_group_name=resource_group_name, @@ -989,9 +1003,9 @@ def _regenerate_auth_token_initial( # pylint: disable=inconsistent-return-state params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1005,7 +1019,9 @@ def _regenerate_auth_token_initial( # pylint: disable=inconsistent-return-state if cls: return cls(pipeline_response, None, {}) - _regenerate_auth_token_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken"} # type: ignore + _regenerate_auth_token_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken" + } @distributed_trace def begin_regenerate_auth_token( @@ -1040,13 +1056,13 @@ def begin_regenerate_auth_token( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._regenerate_auth_token_initial( # type: ignore resource_group_name=resource_group_name, @@ -1065,7 +1081,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1077,9 +1093,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_regenerate_auth_token.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken"} # type: ignore + begin_regenerate_auth_token.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken" + } def _start_initial( # pylint: disable=inconsistent-return-statements self, @@ -1099,10 +1117,10 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_start_request( resource_group_name=resource_group_name, @@ -1115,9 +1133,9 @@ def _start_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1131,7 +1149,9 @@ def _start_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _start_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/start"} # type: ignore + _start_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/start" + } @distributed_trace def begin_start( @@ -1166,13 +1186,13 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._start_initial( # type: ignore resource_group_name=resource_group_name, @@ -1191,7 +1211,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1203,6 +1223,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/start"} # type: ignore + begin_start.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/start" + } 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 2fbc8b7deb6c..0d6a82b96bc4 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 @@ -45,9 +45,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,10 +93,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] + ) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -116,7 +116,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -132,7 +132,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -140,13 +140,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -159,4 +159,4 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.DocumentDB/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.DocumentDB/operations"} 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 db390f0e246d..7381e4d4b719 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 @@ -55,9 +55,9 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,7 +78,7 @@ def build_list_metrics_request( "partitionKeyRangeId": _SERIALIZER.url("partition_key_range_id", partition_key_range_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -145,10 +145,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PartitionMetricListResult] + ) + cls: ClsType[_models.PartitionMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -175,7 +175,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -191,7 +191,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -199,13 +199,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("PartitionMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -218,4 +218,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics" + } 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 db837aefe5ef..0d4670f2dfb2 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 @@ -56,9 +56,9 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,7 +80,7 @@ def build_list_metrics_request( "partitionKeyRangeId": _SERIALIZER.url("partition_key_range_id", partition_key_range_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -151,10 +151,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PartitionMetricListResult] + ) + cls: ClsType[_models.PartitionMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -182,7 +182,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -198,7 +198,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -206,13 +206,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("PartitionMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -225,4 +225,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics" + } 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 a9c47c6ff1ad..b9631e1a4426 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 @@ -47,9 +47,9 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +67,7 @@ def build_list_metrics_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -122,10 +122,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PercentileMetricListResult] + ) + cls: ClsType[_models.PercentileMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -149,7 +149,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -165,7 +165,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -173,13 +173,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("PercentileMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -192,4 +192,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/percentile/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/percentile/metrics" + } 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 1c7697c6c969..b688c72e766a 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 @@ -54,9 +54,9 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +76,7 @@ def build_list_metrics_request( "targetRegion": _SERIALIZER.url("target_region", target_region, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -143,10 +143,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PercentileMetricListResult] + ) + cls: ClsType[_models.PercentileMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -172,7 +172,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -188,7 +188,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -196,13 +196,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("PercentileMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -215,4 +215,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sourceRegion/{sourceRegion}/targetRegion/{targetRegion}/percentile/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sourceRegion/{sourceRegion}/targetRegion/{targetRegion}/percentile/metrics" + } 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 276f2c7c4089..51440d6d6721 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 @@ -47,9 +47,9 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -68,7 +68,7 @@ def build_list_metrics_request( "targetRegion": _SERIALIZER.url("target_region", target_region, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -126,10 +126,10 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PercentileMetricListResult] + ) + cls: ClsType[_models.PercentileMetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -154,7 +154,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -170,7 +170,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -178,13 +178,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("PercentileMetricListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -197,4 +197,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/targetRegion/{targetRegion}/percentile/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/targetRegion/{targetRegion}/percentile/metrics" + } 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 35c730832763..d60d7da9a98f 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,9 +49,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_by_database_account_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -90,9 +90,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,7 +113,7 @@ def build_get_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -134,10 +134,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -158,7 +158,7 @@ def build_create_or_update_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -181,9 +181,9 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -204,7 +204,7 @@ def build_delete_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -254,10 +254,10 @@ def list_by_database_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] + ) + cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -280,7 +280,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -296,7 +296,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -304,13 +304,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -323,7 +323,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database_account.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections"} # type: ignore + list_by_database_account.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections" + } @distributed_trace def get( @@ -354,10 +356,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] + ) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -370,9 +372,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -389,7 +391,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" + } def _create_or_update_initial( self, @@ -410,11 +414,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PrivateEndpointConnection]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PrivateEndpointConnection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -438,9 +442,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -460,7 +464,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @overload def begin_create_or_update( @@ -579,16 +585,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, account_name=account_name, private_endpoint_connection_name=private_endpoint_connection_name, @@ -609,7 +615,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -621,9 +627,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, private_endpoint_connection_name: str, **kwargs: Any @@ -639,10 +647,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -655,9 +663,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -671,7 +679,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @distributed_trace def begin_delete( @@ -701,13 +711,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -726,7 +736,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -738,6 +748,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" + } 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 45dc003f19d8..e0ebf26ce491 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 @@ -47,9 +47,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +67,7 @@ def build_list_by_database_account_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -84,9 +84,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +105,7 @@ def build_get_request( "groupName": _SERIALIZER.url("group_name", group_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -154,10 +154,10 @@ def list_by_database_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] + ) + cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -180,7 +180,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -196,7 +196,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -204,13 +204,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -223,7 +223,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database_account.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateLinkResources"} # type: ignore + list_by_database_account.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateLinkResources" + } @distributed_trace def get( @@ -254,10 +256,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResource] + ) + cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -270,9 +272,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -289,4 +291,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateLinkResources/{groupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateLinkResources/{groupName}" + } 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 d427dee29773..50079da9061f 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 @@ -45,9 +45,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -60,7 +60,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs "location": _SERIALIZER.url("location", location, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -75,9 +75,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +88,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -103,9 +103,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -119,7 +119,7 @@ def build_get_by_location_request(location: str, instance_id: str, subscription_ "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -168,10 +168,10 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Re _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDatabaseAccountsListResult] + ) + cls: ClsType[_models.RestorableDatabaseAccountsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -193,7 +193,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -209,7 +209,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -217,13 +217,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorableDatabaseAccountsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -236,7 +236,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts" + } @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.RestorableDatabaseAccountGetResult"]: @@ -253,10 +255,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.RestorableDatabaseAccountGetR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDatabaseAccountsListResult] + ) + cls: ClsType[_models.RestorableDatabaseAccountsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -277,7 +279,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -293,7 +295,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -301,13 +303,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorableDatabaseAccountsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -320,7 +322,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/restorableDatabaseAccounts"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/restorableDatabaseAccounts"} @distributed_trace def get_by_location( @@ -350,10 +352,10 @@ def get_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDatabaseAccountGetResult] + ) + cls: ClsType[_models.RestorableDatabaseAccountGetResult] = kwargs.pop("cls", None) request = build_get_by_location_request( location=location, @@ -365,9 +367,9 @@ def get_by_location( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -384,4 +386,6 @@ def get_by_location( return deserialized - get_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}"} # type: ignore + get_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}" + } 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 2a0410095b85..32267cab3b67 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 @@ -45,9 +45,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +61,7 @@ def build_list_request(location: str, instance_id: str, subscription_id: str, ** "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -115,10 +115,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableGremlinDatabasesListResult] + ) + cls: ClsType[_models.RestorableGremlinDatabasesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -141,7 +141,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -157,7 +157,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -165,13 +165,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorableGremlinDatabasesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -184,4 +184,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinDatabases"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinDatabases" + } 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 c73dc751971f..eb42175418ea 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 @@ -54,9 +54,9 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +70,7 @@ def build_list_request( "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -144,10 +144,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableGremlinGraphsListResult] + ) + cls: ClsType[_models.RestorableGremlinGraphsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -173,7 +173,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -189,7 +189,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -197,13 +197,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorableGremlinGraphsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -216,4 +216,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGraphs"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGraphs" + } 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 0e852217cdea..3eb145800e7d 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 @@ -53,9 +53,9 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_request( "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -140,10 +140,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableGremlinResourcesListResult] + ) + cls: ClsType[_models.RestorableGremlinResourcesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -168,7 +168,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -184,7 +184,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -192,13 +192,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorableGremlinResourcesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -211,4 +211,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinResources"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinResources" + } 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 fef5e5618042..894ea7c919a4 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 @@ -54,9 +54,9 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +70,7 @@ def build_list_request( "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -144,10 +144,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableMongodbCollectionsListResult] + ) + cls: ClsType[_models.RestorableMongodbCollectionsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -173,7 +173,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -189,7 +189,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -197,13 +197,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorableMongodbCollectionsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -216,4 +216,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbCollections"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbCollections" + } 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 ff117c7068be..272d023b9078 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 @@ -45,9 +45,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +61,7 @@ def build_list_request(location: str, instance_id: str, subscription_id: str, ** "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -115,10 +115,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableMongodbDatabasesListResult] + ) + cls: ClsType[_models.RestorableMongodbDatabasesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -141,7 +141,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -157,7 +157,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -165,13 +165,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorableMongodbDatabasesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -184,4 +184,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbDatabases"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbDatabases" + } 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 8028af9f27e2..a927203af4b5 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 @@ -53,9 +53,9 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_request( "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -140,10 +140,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableMongodbResourcesListResult] + ) + cls: ClsType[_models.RestorableMongodbResourcesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -168,7 +168,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -184,7 +184,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -192,13 +192,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorableMongodbResourcesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -211,4 +211,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbResources"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbResources" + } 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 8f0b9244cb88..6c9385cd4fb2 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 @@ -54,9 +54,9 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +70,7 @@ def build_list_request( "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -143,10 +143,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableSqlContainersListResult] + ) + cls: ClsType[_models.RestorableSqlContainersListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -172,7 +172,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -188,7 +188,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -196,13 +196,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorableSqlContainersListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -215,4 +215,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlContainers"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlContainers" + } 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 d87fd6a1ecb9..68a5eb6c8cc4 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 @@ -45,9 +45,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +61,7 @@ def build_list_request(location: str, instance_id: str, subscription_id: str, ** "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -115,10 +115,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableSqlDatabasesListResult] + ) + cls: ClsType[_models.RestorableSqlDatabasesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -141,7 +141,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -157,7 +157,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -165,13 +165,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorableSqlDatabasesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -184,4 +184,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlDatabases"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlDatabases" + } 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 299968b5dac9..062ea8e75d0e 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 @@ -53,9 +53,9 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_request( "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -140,10 +140,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableSqlResourcesListResult] + ) + cls: ClsType[_models.RestorableSqlResourcesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -168,7 +168,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -184,7 +184,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -192,13 +192,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorableSqlResourcesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -211,4 +211,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlResources"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlResources" + } 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 33b684d69fa6..7d55a9dd5a4c 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 @@ -53,9 +53,9 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_request( "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -139,10 +139,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableTableResourcesListResult] + ) + cls: ClsType[_models.RestorableTableResourcesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -167,7 +167,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -183,7 +183,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -191,13 +191,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorableTableResourcesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -210,4 +210,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTableResources"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTableResources" + } 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 631848b04df2..fec3e1f90026 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 @@ -53,9 +53,9 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_request( "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -134,10 +134,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableTablesListResult] + ) + cls: ClsType[_models.RestorableTablesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -162,7 +162,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -178,7 +178,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -186,13 +186,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RestorableTablesListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -205,4 +205,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTables"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTables" + } 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 d8999828d165..b97ef01d2c3c 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,9 +47,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +67,7 @@ def build_list_request(resource_group_name: str, account_name: str, subscription ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -84,10 +84,10 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -106,7 +106,7 @@ def build_create_request( "serviceName": _SERIALIZER.url("service_name", service_name, "str", max_length=50, min_length=3), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -125,9 +125,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_get_request( "serviceName": _SERIALIZER.url("service_name", service_name, "str", max_length=50, min_length=3), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -163,9 +163,9 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -184,7 +184,7 @@ def build_delete_request( "serviceName": _SERIALIZER.url("service_name", service_name, "str", max_length=50, min_length=3), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -231,10 +231,10 @@ def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> It _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceResourceListResult] + ) + cls: ClsType[_models.ServiceResourceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -257,7 +257,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -273,7 +273,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -281,13 +281,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ServiceResourceListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -300,7 +300,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services" + } def _create_initial( self, @@ -321,11 +323,11 @@ def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServiceResource]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServiceResource]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -349,9 +351,9 @@ def _create_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -370,7 +372,9 @@ def _create_initial( return deserialized - _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}"} # type: ignore + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}" + } @overload def begin_create( @@ -492,16 +496,16 @@ def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceResource] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_initial( # type: ignore + raw_result = self._create_initial( resource_group_name=resource_group_name, account_name=account_name, service_name=service_name, @@ -522,7 +526,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -534,9 +538,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}"} # type: ignore + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}" + } @distributed_trace def get( @@ -567,10 +573,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceResource] + ) + cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -583,9 +589,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -602,7 +608,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, service_name: str, **kwargs: Any @@ -618,10 +626,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -634,9 +642,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -649,7 +657,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}" + } @distributed_trace def begin_delete( @@ -679,13 +689,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -704,7 +714,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -716,6 +726,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}" + } 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 3bf700b9605e..f468f2dff250 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 @@ -49,9 +49,9 @@ def build_list_sql_databases_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_sql_databases_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -86,9 +86,9 @@ def build_get_sql_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +107,7 @@ def build_get_sql_database_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -124,10 +124,10 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_create_update_sql_database_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -164,9 +164,9 @@ def build_delete_sql_database_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) # Construct URL _url = kwargs.pop( "template_url", @@ -183,7 +183,7 @@ def build_delete_sql_database_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -197,9 +197,9 @@ def build_get_sql_database_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +218,7 @@ def build_get_sql_database_throughput_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -235,10 +235,10 @@ def build_update_sql_database_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -257,7 +257,7 @@ def build_update_sql_database_throughput_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -276,9 +276,9 @@ def build_migrate_sql_database_to_autoscale_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -297,7 +297,7 @@ def build_migrate_sql_database_to_autoscale_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -314,9 +314,9 @@ def build_migrate_sql_database_to_manual_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -335,7 +335,7 @@ def build_migrate_sql_database_to_manual_throughput_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -352,9 +352,9 @@ def build_list_client_encryption_keys_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -373,7 +373,7 @@ def build_list_client_encryption_keys_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -395,9 +395,9 @@ def build_get_client_encryption_key_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -417,7 +417,7 @@ def build_get_client_encryption_key_request( "clientEncryptionKeyName": _SERIALIZER.url("client_encryption_key_name", client_encryption_key_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -439,10 +439,10 @@ def build_create_update_client_encryption_key_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -462,7 +462,7 @@ def build_create_update_client_encryption_key_request( "clientEncryptionKeyName": _SERIALIZER.url("client_encryption_key_name", client_encryption_key_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -481,9 +481,9 @@ def build_list_sql_containers_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -502,7 +502,7 @@ def build_list_sql_containers_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -524,9 +524,9 @@ def build_get_sql_container_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -546,7 +546,7 @@ def build_get_sql_container_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -568,10 +568,10 @@ def build_create_update_sql_container_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -591,7 +591,7 @@ def build_create_update_sql_container_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -614,9 +614,9 @@ def build_delete_sql_container_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) # Construct URL _url = kwargs.pop( "template_url", @@ -634,7 +634,7 @@ def build_delete_sql_container_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -653,10 +653,10 @@ def build_list_sql_container_partition_merge_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -676,7 +676,7 @@ def build_list_sql_container_partition_merge_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -700,9 +700,9 @@ def build_get_sql_container_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -722,7 +722,7 @@ def build_get_sql_container_throughput_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -744,10 +744,10 @@ def build_update_sql_container_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -767,7 +767,7 @@ def build_update_sql_container_throughput_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -791,9 +791,9 @@ def build_migrate_sql_container_to_autoscale_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -813,7 +813,7 @@ def build_migrate_sql_container_to_autoscale_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -835,9 +835,9 @@ def build_migrate_sql_container_to_manual_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -857,7 +857,7 @@ def build_migrate_sql_container_to_manual_throughput_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -874,10 +874,10 @@ def build_sql_database_retrieve_throughput_distribution_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -896,7 +896,7 @@ def build_sql_database_retrieve_throughput_distribution_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -915,10 +915,10 @@ def build_sql_database_redistribute_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -937,7 +937,7 @@ def build_sql_database_redistribute_throughput_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -961,10 +961,10 @@ def build_sql_container_retrieve_throughput_distribution_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -984,7 +984,7 @@ def build_sql_container_retrieve_throughput_distribution_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1008,10 +1008,10 @@ def build_sql_container_redistribute_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1031,7 +1031,7 @@ def build_sql_container_redistribute_throughput_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1055,9 +1055,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1077,7 +1077,7 @@ def build_list_sql_stored_procedures_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1100,9 +1100,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1123,7 +1123,7 @@ def build_get_sql_stored_procedure_request( "storedProcedureName": _SERIALIZER.url("stored_procedure_name", stored_procedure_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1146,10 +1146,10 @@ def build_create_update_sql_stored_procedure_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1170,7 +1170,7 @@ def build_create_update_sql_stored_procedure_request( "storedProcedureName": _SERIALIZER.url("stored_procedure_name", stored_procedure_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1194,9 +1194,9 @@ def build_delete_sql_stored_procedure_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) # Construct URL _url = kwargs.pop( "template_url", @@ -1215,7 +1215,7 @@ def build_delete_sql_stored_procedure_request( "storedProcedureName": _SERIALIZER.url("stored_procedure_name", stored_procedure_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1234,9 +1234,9 @@ def build_list_sql_user_defined_functions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1256,7 +1256,7 @@ def build_list_sql_user_defined_functions_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1279,9 +1279,9 @@ def build_get_sql_user_defined_function_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1302,7 +1302,7 @@ def build_get_sql_user_defined_function_request( "userDefinedFunctionName": _SERIALIZER.url("user_defined_function_name", user_defined_function_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1325,10 +1325,10 @@ def build_create_update_sql_user_defined_function_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1349,7 +1349,7 @@ def build_create_update_sql_user_defined_function_request( "userDefinedFunctionName": _SERIALIZER.url("user_defined_function_name", user_defined_function_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1373,9 +1373,9 @@ def build_delete_sql_user_defined_function_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) # Construct URL _url = kwargs.pop( "template_url", @@ -1394,7 +1394,7 @@ def build_delete_sql_user_defined_function_request( "userDefinedFunctionName": _SERIALIZER.url("user_defined_function_name", user_defined_function_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1413,9 +1413,9 @@ def build_list_sql_triggers_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1435,7 +1435,7 @@ def build_list_sql_triggers_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1458,9 +1458,9 @@ def build_get_sql_trigger_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1481,7 +1481,7 @@ def build_get_sql_trigger_request( "triggerName": _SERIALIZER.url("trigger_name", trigger_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1504,10 +1504,10 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1528,7 +1528,7 @@ def build_create_update_sql_trigger_request( "triggerName": _SERIALIZER.url("trigger_name", trigger_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1552,9 +1552,9 @@ def build_delete_sql_trigger_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) # Construct URL _url = kwargs.pop( "template_url", @@ -1573,7 +1573,7 @@ def build_delete_sql_trigger_request( "triggerName": _SERIALIZER.url("trigger_name", trigger_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1587,9 +1587,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1608,7 +1608,7 @@ def build_get_sql_role_definition_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1625,10 +1625,10 @@ def build_create_update_sql_role_definition_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1647,7 +1647,7 @@ def build_create_update_sql_role_definition_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1666,9 +1666,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1687,7 +1687,7 @@ def build_delete_sql_role_definition_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1704,9 +1704,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1724,7 +1724,7 @@ def build_list_sql_role_definitions_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1741,9 +1741,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1762,7 +1762,7 @@ def build_get_sql_role_assignment_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1779,10 +1779,10 @@ def build_create_update_sql_role_assignment_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1801,7 +1801,7 @@ def build_create_update_sql_role_assignment_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1820,9 +1820,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1841,7 +1841,7 @@ def build_delete_sql_role_assignment_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1858,9 +1858,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1878,7 +1878,7 @@ def build_list_sql_role_assignments_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1900,10 +1900,10 @@ def build_retrieve_continuous_backup_information_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1923,7 +1923,7 @@ def build_retrieve_continuous_backup_information_request( "containerName": _SERIALIZER.url("container_name", container_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1975,10 +1975,10 @@ def list_sql_databases( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlDatabaseListResult] + ) + cls: ClsType[_models.SqlDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2001,7 +2001,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -2017,7 +2017,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2025,13 +2025,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SqlDatabaseListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2044,7 +2044,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_sql_databases.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases"} # type: ignore + list_sql_databases.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases" + } @distributed_trace def get_sql_database( @@ -2076,10 +2078,10 @@ def get_sql_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlDatabaseGetResults] + ) + cls: ClsType[_models.SqlDatabaseGetResults] = kwargs.pop("cls", None) request = build_get_sql_database_request( resource_group_name=resource_group_name, @@ -2092,9 +2094,9 @@ def get_sql_database( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2111,7 +2113,9 @@ def get_sql_database( return deserialized - get_sql_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}"} # type: ignore + get_sql_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}" + } def _create_update_sql_database_initial( self, @@ -2132,11 +2136,11 @@ def _create_update_sql_database_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlDatabaseGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlDatabaseGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2160,9 +2164,9 @@ def _create_update_sql_database_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2181,7 +2185,9 @@ def _create_update_sql_database_initial( return deserialized - _create_update_sql_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}"} # type: ignore + _create_update_sql_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}" + } @overload def begin_create_update_sql_database( @@ -2305,16 +2311,16 @@ def begin_create_update_sql_database( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlDatabaseGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlDatabaseGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_sql_database_initial( # type: ignore + raw_result = self._create_update_sql_database_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2335,7 +2341,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2347,9 +2353,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}"} # type: ignore + begin_create_update_sql_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}" + } def _delete_sql_database_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -2365,10 +2373,10 @@ def _delete_sql_database_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_database_request( resource_group_name=resource_group_name, @@ -2381,9 +2389,9 @@ def _delete_sql_database_initial( # pylint: disable=inconsistent-return-stateme params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2396,7 +2404,9 @@ def _delete_sql_database_initial( # pylint: disable=inconsistent-return-stateme if cls: return cls(pipeline_response, None, {}) - _delete_sql_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}"} # type: ignore + _delete_sql_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}" + } @distributed_trace def begin_delete_sql_database( @@ -2426,13 +2436,13 @@ def begin_delete_sql_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_sql_database_initial( # type: ignore resource_group_name=resource_group_name, @@ -2451,7 +2461,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2463,9 +2473,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}"} # type: ignore + begin_delete_sql_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}" + } @distributed_trace def get_sql_database_throughput( @@ -2497,10 +2509,10 @@ def get_sql_database_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_sql_database_throughput_request( resource_group_name=resource_group_name, @@ -2513,9 +2525,9 @@ def get_sql_database_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2532,7 +2544,9 @@ def get_sql_database_throughput( return deserialized - get_sql_database_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default"} # type: ignore + get_sql_database_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default" + } def _update_sql_database_throughput_initial( self, @@ -2553,11 +2567,11 @@ def _update_sql_database_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -2581,9 +2595,9 @@ def _update_sql_database_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2602,7 +2616,9 @@ def _update_sql_database_throughput_initial( return deserialized - _update_sql_database_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default"} # type: ignore + _update_sql_database_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default" + } @overload def begin_update_sql_database_throughput( @@ -2726,16 +2742,16 @@ def begin_update_sql_database_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_sql_database_throughput_initial( # type: ignore + raw_result = self._update_sql_database_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2756,7 +2772,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2768,9 +2784,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_sql_database_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default"} # type: ignore + begin_update_sql_database_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default" + } def _migrate_sql_database_to_autoscale_initial( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -2786,10 +2804,10 @@ def _migrate_sql_database_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_sql_database_to_autoscale_request( resource_group_name=resource_group_name, @@ -2802,9 +2820,9 @@ def _migrate_sql_database_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2823,7 +2841,9 @@ def _migrate_sql_database_to_autoscale_initial( return deserialized - _migrate_sql_database_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_sql_database_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace def begin_migrate_sql_database_to_autoscale( @@ -2854,15 +2874,15 @@ def begin_migrate_sql_database_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_sql_database_to_autoscale_initial( # type: ignore + raw_result = self._migrate_sql_database_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2881,7 +2901,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2893,9 +2913,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_sql_database_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_sql_database_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale" + } def _migrate_sql_database_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any @@ -2911,10 +2933,10 @@ def _migrate_sql_database_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_sql_database_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -2927,9 +2949,9 @@ def _migrate_sql_database_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2948,7 +2970,9 @@ def _migrate_sql_database_to_manual_throughput_initial( return deserialized - _migrate_sql_database_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_sql_database_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def begin_migrate_sql_database_to_manual_throughput( @@ -2979,15 +3003,15 @@ def begin_migrate_sql_database_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_sql_database_to_manual_throughput_initial( # type: ignore + raw_result = self._migrate_sql_database_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3006,7 +3030,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3018,9 +3042,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_sql_database_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_sql_database_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def list_client_encryption_keys( @@ -3044,10 +3070,10 @@ def list_client_encryption_keys( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClientEncryptionKeysListResult] + ) + cls: ClsType[_models.ClientEncryptionKeysListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -3071,7 +3097,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -3087,7 +3113,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -3095,13 +3121,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -3114,7 +3140,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_client_encryption_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys"} # type: ignore + list_client_encryption_keys.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys" + } @distributed_trace def get_client_encryption_key( @@ -3152,10 +3180,10 @@ def get_client_encryption_key( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClientEncryptionKeyGetResults] + ) + cls: ClsType[_models.ClientEncryptionKeyGetResults] = kwargs.pop("cls", None) request = build_get_client_encryption_key_request( resource_group_name=resource_group_name, @@ -3169,9 +3197,9 @@ def get_client_encryption_key( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3188,7 +3216,9 @@ def get_client_encryption_key( return deserialized - get_client_encryption_key.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}"} # type: ignore + get_client_encryption_key.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}" + } def _create_update_client_encryption_key_initial( self, @@ -3210,11 +3240,11 @@ def _create_update_client_encryption_key_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ClientEncryptionKeyGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ClientEncryptionKeyGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -3241,9 +3271,9 @@ def _create_update_client_encryption_key_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3262,7 +3292,9 @@ def _create_update_client_encryption_key_initial( return deserialized - _create_update_client_encryption_key_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}"} # type: ignore + _create_update_client_encryption_key_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}" + } @overload def begin_create_update_client_encryption_key( @@ -3401,16 +3433,16 @@ def begin_create_update_client_encryption_key( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClientEncryptionKeyGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_client_encryption_key_initial( # type: ignore + raw_result = self._create_update_client_encryption_key_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3432,7 +3464,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3444,9 +3476,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_client_encryption_key.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}"} # type: ignore + begin_create_update_client_encryption_key.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}" + } @distributed_trace def list_sql_containers( @@ -3470,10 +3504,10 @@ def list_sql_containers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlContainerListResult] + ) + cls: ClsType[_models.SqlContainerListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -3497,7 +3531,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -3513,7 +3547,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -3521,13 +3555,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SqlContainerListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -3540,7 +3574,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_sql_containers.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers"} # type: ignore + list_sql_containers.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers" + } @distributed_trace def get_sql_container( @@ -3573,10 +3609,10 @@ def get_sql_container( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlContainerGetResults] + ) + cls: ClsType[_models.SqlContainerGetResults] = kwargs.pop("cls", None) request = build_get_sql_container_request( resource_group_name=resource_group_name, @@ -3590,9 +3626,9 @@ def get_sql_container( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3609,7 +3645,9 @@ def get_sql_container( return deserialized - get_sql_container.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}"} # type: ignore + get_sql_container.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}" + } def _create_update_sql_container_initial( self, @@ -3631,11 +3669,11 @@ def _create_update_sql_container_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlContainerGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlContainerGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -3660,9 +3698,9 @@ def _create_update_sql_container_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3681,7 +3719,9 @@ def _create_update_sql_container_initial( return deserialized - _create_update_sql_container_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}"} # type: ignore + _create_update_sql_container_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}" + } @overload def begin_create_update_sql_container( @@ -3814,16 +3854,16 @@ def begin_create_update_sql_container( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlContainerGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_sql_container_initial( # type: ignore + raw_result = self._create_update_sql_container_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3845,7 +3885,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3857,9 +3897,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_container.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}"} # type: ignore + begin_create_update_sql_container.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}" + } def _delete_sql_container_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any @@ -3875,10 +3917,10 @@ def _delete_sql_container_initial( # pylint: disable=inconsistent-return-statem _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_container_request( resource_group_name=resource_group_name, @@ -3892,9 +3934,9 @@ def _delete_sql_container_initial( # pylint: disable=inconsistent-return-statem params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -3907,7 +3949,9 @@ def _delete_sql_container_initial( # pylint: disable=inconsistent-return-statem if cls: return cls(pipeline_response, None, {}) - _delete_sql_container_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}"} # type: ignore + _delete_sql_container_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}" + } @distributed_trace def begin_delete_sql_container( @@ -3939,13 +3983,13 @@ def begin_delete_sql_container( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_sql_container_initial( # type: ignore resource_group_name=resource_group_name, @@ -3965,7 +4009,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -3977,9 +4021,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_container.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}"} # type: ignore + begin_delete_sql_container.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}" + } def _list_sql_container_partition_merge_initial( self, @@ -4001,11 +4047,11 @@ def _list_sql_container_partition_merge_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionStorageInfoCollection]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionStorageInfoCollection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -4030,9 +4076,9 @@ def _list_sql_container_partition_merge_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4051,7 +4097,9 @@ def _list_sql_container_partition_merge_initial( return deserialized - _list_sql_container_partition_merge_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge"} # type: ignore + _list_sql_container_partition_merge_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge" + } @overload def begin_list_sql_container_partition_merge( @@ -4183,16 +4231,16 @@ def begin_list_sql_container_partition_merge( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionStorageInfoCollection] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._list_sql_container_partition_merge_initial( # type: ignore + raw_result = self._list_sql_container_partition_merge_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -4214,9 +4262,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -4228,9 +4276,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_list_sql_container_partition_merge.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge"} # type: ignore + begin_list_sql_container_partition_merge.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge" + } @distributed_trace def get_sql_container_throughput( @@ -4264,10 +4314,10 @@ def get_sql_container_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_sql_container_throughput_request( resource_group_name=resource_group_name, @@ -4281,9 +4331,9 @@ def get_sql_container_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4300,7 +4350,9 @@ def get_sql_container_throughput( return deserialized - get_sql_container_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default"} # type: ignore + get_sql_container_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default" + } def _update_sql_container_throughput_initial( self, @@ -4322,11 +4374,11 @@ def _update_sql_container_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -4351,9 +4403,9 @@ def _update_sql_container_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4372,7 +4424,9 @@ def _update_sql_container_throughput_initial( return deserialized - _update_sql_container_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default"} # type: ignore + _update_sql_container_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default" + } @overload def begin_update_sql_container_throughput( @@ -4505,16 +4559,16 @@ def begin_update_sql_container_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_sql_container_throughput_initial( # type: ignore + raw_result = self._update_sql_container_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -4536,7 +4590,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -4548,9 +4602,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_sql_container_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default"} # type: ignore + begin_update_sql_container_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default" + } def _migrate_sql_container_to_autoscale_initial( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any @@ -4566,10 +4622,10 @@ def _migrate_sql_container_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_sql_container_to_autoscale_request( resource_group_name=resource_group_name, @@ -4583,9 +4639,9 @@ def _migrate_sql_container_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4604,7 +4660,9 @@ def _migrate_sql_container_to_autoscale_initial( return deserialized - _migrate_sql_container_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_sql_container_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace def begin_migrate_sql_container_to_autoscale( @@ -4637,15 +4695,15 @@ def begin_migrate_sql_container_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_sql_container_to_autoscale_initial( # type: ignore + raw_result = self._migrate_sql_container_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -4665,7 +4723,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -4677,9 +4735,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_sql_container_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_sql_container_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale" + } def _migrate_sql_container_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any @@ -4695,10 +4755,10 @@ def _migrate_sql_container_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_sql_container_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -4712,9 +4772,9 @@ def _migrate_sql_container_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4733,7 +4793,9 @@ def _migrate_sql_container_to_manual_throughput_initial( return deserialized - _migrate_sql_container_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_sql_container_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def begin_migrate_sql_container_to_manual_throughput( @@ -4766,15 +4828,15 @@ def begin_migrate_sql_container_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_sql_container_to_manual_throughput_initial( # type: ignore + raw_result = self._migrate_sql_container_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -4794,7 +4856,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -4806,9 +4868,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_sql_container_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_sql_container_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput" + } def _sql_database_retrieve_throughput_distribution_initial( self, @@ -4829,11 +4893,11 @@ def _sql_database_retrieve_throughput_distribution_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -4857,9 +4921,9 @@ def _sql_database_retrieve_throughput_distribution_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -4878,7 +4942,9 @@ def _sql_database_retrieve_throughput_distribution_initial( return deserialized - _sql_database_retrieve_throughput_distribution_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + _sql_database_retrieve_throughput_distribution_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution" + } @overload def begin_sql_database_retrieve_throughput_distribution( @@ -5004,16 +5070,16 @@ def begin_sql_database_retrieve_throughput_distribution( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._sql_database_retrieve_throughput_distribution_initial( # type: ignore + raw_result = self._sql_database_retrieve_throughput_distribution_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -5034,9 +5100,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -5048,9 +5114,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_sql_database_retrieve_throughput_distribution.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + begin_sql_database_retrieve_throughput_distribution.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution" + } def _sql_database_redistribute_throughput_initial( self, @@ -5071,11 +5139,11 @@ def _sql_database_redistribute_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -5099,9 +5167,9 @@ def _sql_database_redistribute_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5120,7 +5188,9 @@ def _sql_database_redistribute_throughput_initial( return deserialized - _sql_database_redistribute_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/redistributeThroughput"} # type: ignore + _sql_database_redistribute_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/redistributeThroughput" + } @overload def begin_sql_database_redistribute_throughput( @@ -5247,16 +5317,16 @@ def begin_sql_database_redistribute_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._sql_database_redistribute_throughput_initial( # type: ignore + raw_result = self._sql_database_redistribute_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -5277,9 +5347,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -5291,9 +5361,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_sql_database_redistribute_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/redistributeThroughput"} # type: ignore + begin_sql_database_redistribute_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/redistributeThroughput" + } def _sql_container_retrieve_throughput_distribution_initial( self, @@ -5315,11 +5387,11 @@ def _sql_container_retrieve_throughput_distribution_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -5344,9 +5416,9 @@ def _sql_container_retrieve_throughput_distribution_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5365,7 +5437,9 @@ def _sql_container_retrieve_throughput_distribution_initial( return deserialized - _sql_container_retrieve_throughput_distribution_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + _sql_container_retrieve_throughput_distribution_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution" + } @overload def begin_sql_container_retrieve_throughput_distribution( @@ -5500,16 +5574,16 @@ def begin_sql_container_retrieve_throughput_distribution( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._sql_container_retrieve_throughput_distribution_initial( # type: ignore + raw_result = self._sql_container_retrieve_throughput_distribution_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -5531,9 +5605,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -5545,9 +5619,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_sql_container_retrieve_throughput_distribution.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore + begin_sql_container_retrieve_throughput_distribution.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution" + } def _sql_container_redistribute_throughput_initial( self, @@ -5569,11 +5645,11 @@ def _sql_container_redistribute_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PhysicalPartitionThroughputInfoResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -5598,9 +5674,9 @@ def _sql_container_redistribute_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5619,7 +5695,9 @@ def _sql_container_redistribute_throughput_initial( return deserialized - _sql_container_redistribute_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput"} # type: ignore + _sql_container_redistribute_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput" + } @overload def begin_sql_container_redistribute_throughput( @@ -5755,16 +5833,16 @@ def begin_sql_container_redistribute_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PhysicalPartitionThroughputInfoResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._sql_container_redistribute_throughput_initial( # type: ignore + raw_result = self._sql_container_redistribute_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -5786,9 +5864,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -5800,9 +5878,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_sql_container_redistribute_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput"} # type: ignore + begin_sql_container_redistribute_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput" + } @distributed_trace def list_sql_stored_procedures( @@ -5828,10 +5908,10 @@ def list_sql_stored_procedures( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlStoredProcedureListResult] + ) + cls: ClsType[_models.SqlStoredProcedureListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -5856,7 +5936,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -5872,7 +5952,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -5880,13 +5960,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SqlStoredProcedureListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -5899,7 +5979,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_sql_stored_procedures.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures"} # type: ignore + list_sql_stored_procedures.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures" + } @distributed_trace def get_sql_stored_procedure( @@ -5940,10 +6022,10 @@ def get_sql_stored_procedure( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlStoredProcedureGetResults] + ) + cls: ClsType[_models.SqlStoredProcedureGetResults] = kwargs.pop("cls", None) request = build_get_sql_stored_procedure_request( resource_group_name=resource_group_name, @@ -5958,9 +6040,9 @@ def get_sql_stored_procedure( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -5977,7 +6059,9 @@ def get_sql_stored_procedure( return deserialized - get_sql_stored_procedure.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}"} # type: ignore + get_sql_stored_procedure.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}" + } def _create_update_sql_stored_procedure_initial( self, @@ -6000,11 +6084,11 @@ def _create_update_sql_stored_procedure_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlStoredProcedureGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlStoredProcedureGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -6032,9 +6116,9 @@ def _create_update_sql_stored_procedure_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -6053,7 +6137,9 @@ def _create_update_sql_stored_procedure_initial( return deserialized - _create_update_sql_stored_procedure_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}"} # type: ignore + _create_update_sql_stored_procedure_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}" + } @overload def begin_create_update_sql_stored_procedure( @@ -6195,16 +6281,16 @@ def begin_create_update_sql_stored_procedure( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlStoredProcedureGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlStoredProcedureGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_sql_stored_procedure_initial( # type: ignore + raw_result = self._create_update_sql_stored_procedure_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -6227,7 +6313,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -6239,9 +6325,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_stored_procedure.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}"} # type: ignore + begin_create_update_sql_stored_procedure.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}" + } def _delete_sql_stored_procedure_initial( # pylint: disable=inconsistent-return-statements self, @@ -6263,10 +6351,10 @@ def _delete_sql_stored_procedure_initial( # pylint: disable=inconsistent-return _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_stored_procedure_request( resource_group_name=resource_group_name, @@ -6281,9 +6369,9 @@ def _delete_sql_stored_procedure_initial( # pylint: disable=inconsistent-return params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -6296,7 +6384,9 @@ def _delete_sql_stored_procedure_initial( # pylint: disable=inconsistent-return if cls: return cls(pipeline_response, None, {}) - _delete_sql_stored_procedure_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}"} # type: ignore + _delete_sql_stored_procedure_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}" + } @distributed_trace def begin_delete_sql_stored_procedure( @@ -6336,13 +6426,13 @@ def begin_delete_sql_stored_procedure( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_sql_stored_procedure_initial( # type: ignore resource_group_name=resource_group_name, @@ -6363,7 +6453,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -6375,9 +6465,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_stored_procedure.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}"} # type: ignore + begin_delete_sql_stored_procedure.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}" + } @distributed_trace def list_sql_user_defined_functions( @@ -6404,10 +6496,10 @@ def list_sql_user_defined_functions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlUserDefinedFunctionListResult] + ) + cls: ClsType[_models.SqlUserDefinedFunctionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -6432,7 +6524,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -6448,7 +6540,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -6456,13 +6548,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SqlUserDefinedFunctionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -6475,7 +6567,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_sql_user_defined_functions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions"} # type: ignore + list_sql_user_defined_functions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions" + } @distributed_trace def get_sql_user_defined_function( @@ -6516,10 +6610,10 @@ def get_sql_user_defined_function( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlUserDefinedFunctionGetResults] + ) + cls: ClsType[_models.SqlUserDefinedFunctionGetResults] = kwargs.pop("cls", None) request = build_get_sql_user_defined_function_request( resource_group_name=resource_group_name, @@ -6534,9 +6628,9 @@ def get_sql_user_defined_function( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -6553,7 +6647,9 @@ def get_sql_user_defined_function( return deserialized - get_sql_user_defined_function.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}"} # type: ignore + get_sql_user_defined_function.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}" + } def _create_update_sql_user_defined_function_initial( self, @@ -6578,11 +6674,11 @@ def _create_update_sql_user_defined_function_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlUserDefinedFunctionGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlUserDefinedFunctionGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -6610,9 +6706,9 @@ def _create_update_sql_user_defined_function_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -6631,7 +6727,9 @@ def _create_update_sql_user_defined_function_initial( return deserialized - _create_update_sql_user_defined_function_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}"} # type: ignore + _create_update_sql_user_defined_function_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}" + } @overload def begin_create_update_sql_user_defined_function( @@ -6778,16 +6876,16 @@ def begin_create_update_sql_user_defined_function( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlUserDefinedFunctionGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlUserDefinedFunctionGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_sql_user_defined_function_initial( # type: ignore + raw_result = self._create_update_sql_user_defined_function_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -6810,7 +6908,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -6822,9 +6920,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_user_defined_function.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}"} # type: ignore + begin_create_update_sql_user_defined_function.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}" + } def _delete_sql_user_defined_function_initial( # pylint: disable=inconsistent-return-statements self, @@ -6846,10 +6946,10 @@ def _delete_sql_user_defined_function_initial( # pylint: disable=inconsistent-r _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_user_defined_function_request( resource_group_name=resource_group_name, @@ -6864,9 +6964,9 @@ def _delete_sql_user_defined_function_initial( # pylint: disable=inconsistent-r params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -6879,7 +6979,9 @@ def _delete_sql_user_defined_function_initial( # pylint: disable=inconsistent-r if cls: return cls(pipeline_response, None, {}) - _delete_sql_user_defined_function_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}"} # type: ignore + _delete_sql_user_defined_function_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}" + } @distributed_trace def begin_delete_sql_user_defined_function( @@ -6919,13 +7021,13 @@ def begin_delete_sql_user_defined_function( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_sql_user_defined_function_initial( # type: ignore resource_group_name=resource_group_name, @@ -6946,7 +7048,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -6958,9 +7060,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_user_defined_function.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}"} # type: ignore + begin_delete_sql_user_defined_function.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}" + } @distributed_trace def list_sql_triggers( @@ -6986,10 +7090,10 @@ def list_sql_triggers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlTriggerListResult] + ) + cls: ClsType[_models.SqlTriggerListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -7014,7 +7118,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -7030,7 +7134,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -7038,13 +7142,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SqlTriggerListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -7057,7 +7161,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_sql_triggers.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers"} # type: ignore + list_sql_triggers.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers" + } @distributed_trace def get_sql_trigger( @@ -7098,10 +7204,10 @@ def get_sql_trigger( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlTriggerGetResults] + ) + cls: ClsType[_models.SqlTriggerGetResults] = kwargs.pop("cls", None) request = build_get_sql_trigger_request( resource_group_name=resource_group_name, @@ -7116,9 +7222,9 @@ def get_sql_trigger( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -7135,7 +7241,9 @@ def get_sql_trigger( return deserialized - get_sql_trigger.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}"} # type: ignore + get_sql_trigger.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}" + } def _create_update_sql_trigger_initial( self, @@ -7158,11 +7266,11 @@ def _create_update_sql_trigger_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlTriggerGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlTriggerGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -7188,9 +7296,9 @@ def _create_update_sql_trigger_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -7209,7 +7317,9 @@ def _create_update_sql_trigger_initial( return deserialized - _create_update_sql_trigger_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}"} # type: ignore + _create_update_sql_trigger_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}" + } @overload def begin_create_update_sql_trigger( @@ -7351,16 +7461,16 @@ def begin_create_update_sql_trigger( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlTriggerGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlTriggerGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_sql_trigger_initial( # type: ignore + raw_result = self._create_update_sql_trigger_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -7383,7 +7493,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -7395,9 +7505,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_trigger.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}"} # type: ignore + begin_create_update_sql_trigger.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}" + } def _delete_sql_trigger_initial( # pylint: disable=inconsistent-return-statements self, @@ -7419,10 +7531,10 @@ def _delete_sql_trigger_initial( # pylint: disable=inconsistent-return-statemen _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_trigger_request( resource_group_name=resource_group_name, @@ -7437,9 +7549,9 @@ def _delete_sql_trigger_initial( # pylint: disable=inconsistent-return-statemen params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -7452,7 +7564,9 @@ def _delete_sql_trigger_initial( # pylint: disable=inconsistent-return-statemen if cls: return cls(pipeline_response, None, {}) - _delete_sql_trigger_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}"} # type: ignore + _delete_sql_trigger_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}" + } @distributed_trace def begin_delete_sql_trigger( @@ -7492,13 +7606,13 @@ def begin_delete_sql_trigger( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_sql_trigger_initial( # type: ignore resource_group_name=resource_group_name, @@ -7519,7 +7633,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -7531,9 +7645,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_trigger.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}"} # type: ignore + begin_delete_sql_trigger.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}" + } @distributed_trace def get_sql_role_definition( @@ -7564,10 +7680,10 @@ def get_sql_role_definition( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlRoleDefinitionGetResults] + ) + cls: ClsType[_models.SqlRoleDefinitionGetResults] = kwargs.pop("cls", None) request = build_get_sql_role_definition_request( role_definition_id=role_definition_id, @@ -7580,9 +7696,9 @@ def get_sql_role_definition( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -7599,7 +7715,9 @@ def get_sql_role_definition( return deserialized - get_sql_role_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}"} # type: ignore + get_sql_role_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}" + } def _create_update_sql_role_definition_initial( self, @@ -7620,11 +7738,11 @@ def _create_update_sql_role_definition_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlRoleDefinitionGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlRoleDefinitionGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -7650,9 +7768,9 @@ def _create_update_sql_role_definition_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -7671,7 +7789,9 @@ def _create_update_sql_role_definition_initial( return deserialized - _create_update_sql_role_definition_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}"} # type: ignore + _create_update_sql_role_definition_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}" + } @overload def begin_create_update_sql_role_definition( @@ -7795,16 +7915,16 @@ def begin_create_update_sql_role_definition( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlRoleDefinitionGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlRoleDefinitionGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_sql_role_definition_initial( # type: ignore + raw_result = self._create_update_sql_role_definition_initial( role_definition_id=role_definition_id, resource_group_name=resource_group_name, account_name=account_name, @@ -7825,7 +7945,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -7837,9 +7957,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_role_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}"} # type: ignore + begin_create_update_sql_role_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}" + } def _delete_sql_role_definition_initial( # pylint: disable=inconsistent-return-statements self, role_definition_id: str, resource_group_name: str, account_name: str, **kwargs: Any @@ -7855,10 +7977,10 @@ def _delete_sql_role_definition_initial( # pylint: disable=inconsistent-return- _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_role_definition_request( role_definition_id=role_definition_id, @@ -7871,9 +7993,9 @@ def _delete_sql_role_definition_initial( # pylint: disable=inconsistent-return- params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -7886,7 +8008,9 @@ def _delete_sql_role_definition_initial( # pylint: disable=inconsistent-return- if cls: return cls(pipeline_response, None, {}) - _delete_sql_role_definition_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}"} # type: ignore + _delete_sql_role_definition_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}" + } @distributed_trace def begin_delete_sql_role_definition( @@ -7916,13 +8040,13 @@ def begin_delete_sql_role_definition( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_sql_role_definition_initial( # type: ignore role_definition_id=role_definition_id, @@ -7941,7 +8065,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -7953,9 +8077,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_role_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}"} # type: ignore + begin_delete_sql_role_definition.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}" + } @distributed_trace def list_sql_role_definitions( @@ -7977,10 +8103,10 @@ def list_sql_role_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlRoleDefinitionListResult] + ) + cls: ClsType[_models.SqlRoleDefinitionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -8003,7 +8129,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -8019,7 +8145,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -8027,13 +8153,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SqlRoleDefinitionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -8046,7 +8172,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_sql_role_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions"} # type: ignore + list_sql_role_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions" + } @distributed_trace def get_sql_role_assignment( @@ -8077,10 +8205,10 @@ def get_sql_role_assignment( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlRoleAssignmentGetResults] + ) + cls: ClsType[_models.SqlRoleAssignmentGetResults] = kwargs.pop("cls", None) request = build_get_sql_role_assignment_request( role_assignment_id=role_assignment_id, @@ -8093,9 +8221,9 @@ def get_sql_role_assignment( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -8112,7 +8240,9 @@ def get_sql_role_assignment( return deserialized - get_sql_role_assignment.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}"} # type: ignore + get_sql_role_assignment.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}" + } def _create_update_sql_role_assignment_initial( self, @@ -8133,11 +8263,11 @@ def _create_update_sql_role_assignment_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SqlRoleAssignmentGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SqlRoleAssignmentGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -8163,9 +8293,9 @@ def _create_update_sql_role_assignment_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -8184,7 +8314,9 @@ def _create_update_sql_role_assignment_initial( return deserialized - _create_update_sql_role_assignment_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}"} # type: ignore + _create_update_sql_role_assignment_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}" + } @overload def begin_create_update_sql_role_assignment( @@ -8308,16 +8440,16 @@ def begin_create_update_sql_role_assignment( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlRoleAssignmentGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlRoleAssignmentGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_sql_role_assignment_initial( # type: ignore + raw_result = self._create_update_sql_role_assignment_initial( role_assignment_id=role_assignment_id, resource_group_name=resource_group_name, account_name=account_name, @@ -8338,7 +8470,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -8350,9 +8482,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_sql_role_assignment.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}"} # type: ignore + begin_create_update_sql_role_assignment.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}" + } def _delete_sql_role_assignment_initial( # pylint: disable=inconsistent-return-statements self, role_assignment_id: str, resource_group_name: str, account_name: str, **kwargs: Any @@ -8368,10 +8502,10 @@ def _delete_sql_role_assignment_initial( # pylint: disable=inconsistent-return- _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_sql_role_assignment_request( role_assignment_id=role_assignment_id, @@ -8384,9 +8518,9 @@ def _delete_sql_role_assignment_initial( # pylint: disable=inconsistent-return- params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -8399,7 +8533,9 @@ def _delete_sql_role_assignment_initial( # pylint: disable=inconsistent-return- if cls: return cls(pipeline_response, None, {}) - _delete_sql_role_assignment_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}"} # type: ignore + _delete_sql_role_assignment_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}" + } @distributed_trace def begin_delete_sql_role_assignment( @@ -8429,13 +8565,13 @@ def begin_delete_sql_role_assignment( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_sql_role_assignment_initial( # type: ignore role_assignment_id=role_assignment_id, @@ -8454,7 +8590,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -8466,9 +8602,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_sql_role_assignment.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}"} # type: ignore + begin_delete_sql_role_assignment.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}" + } @distributed_trace def list_sql_role_assignments( @@ -8490,10 +8628,10 @@ def list_sql_role_assignments( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlRoleAssignmentListResult] + ) + cls: ClsType[_models.SqlRoleAssignmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -8516,7 +8654,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -8532,7 +8670,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -8540,13 +8678,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SqlRoleAssignmentListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -8559,7 +8697,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_sql_role_assignments.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments"} # type: ignore + list_sql_role_assignments.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments" + } def _retrieve_continuous_backup_information_initial( self, @@ -8581,11 +8721,11 @@ def _retrieve_continuous_backup_information_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.BackupInformation]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BackupInformation]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -8610,9 +8750,9 @@ def _retrieve_continuous_backup_information_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -8631,7 +8771,9 @@ def _retrieve_continuous_backup_information_initial( return deserialized - _retrieve_continuous_backup_information_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/retrieveContinuousBackupInformation"} # type: ignore + _retrieve_continuous_backup_information_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/retrieveContinuousBackupInformation" + } @overload def begin_retrieve_continuous_backup_information( @@ -8760,16 +8902,16 @@ def begin_retrieve_continuous_backup_information( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupInformation] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackupInformation] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._retrieve_continuous_backup_information_initial( # type: ignore + raw_result = self._retrieve_continuous_backup_information_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -8791,9 +8933,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -8805,6 +8947,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_retrieve_continuous_backup_information.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/retrieveContinuousBackupInformation"} # type: ignore + begin_retrieve_continuous_backup_information.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/retrieveContinuousBackupInformation" + } 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 f6f4efd13987..7dcc3ca8cd08 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 @@ -49,9 +49,9 @@ def build_list_tables_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_tables_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -86,9 +86,9 @@ def build_get_table_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +107,7 @@ def build_get_table_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -124,10 +124,10 @@ def build_create_update_table_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_create_update_table_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -164,9 +164,9 @@ def build_delete_table_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) # Construct URL _url = kwargs.pop( "template_url", @@ -183,7 +183,7 @@ def build_delete_table_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -197,9 +197,9 @@ def build_get_table_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +218,7 @@ def build_get_table_throughput_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -235,10 +235,10 @@ def build_update_table_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -257,7 +257,7 @@ def build_update_table_throughput_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -276,9 +276,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -297,7 +297,7 @@ def build_migrate_table_to_autoscale_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -314,9 +314,9 @@ def build_migrate_table_to_manual_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -335,7 +335,7 @@ def build_migrate_table_to_manual_throughput_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -352,10 +352,10 @@ def build_retrieve_continuous_backup_information_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-15-preview") - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-11-15-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-11-15-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -374,7 +374,7 @@ def build_retrieve_continuous_backup_information_request( "tableName": _SERIALIZER.url("table_name", table_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -425,10 +425,10 @@ def list_tables( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TableListResult] + ) + cls: ClsType[_models.TableListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -451,7 +451,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -467,7 +467,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -475,13 +475,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("TableListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -494,7 +494,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_tables.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables"} # type: ignore + list_tables.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables" + } @distributed_trace def get_table( @@ -525,10 +527,10 @@ def get_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TableGetResults] + ) + cls: ClsType[_models.TableGetResults] = kwargs.pop("cls", None) request = build_get_table_request( resource_group_name=resource_group_name, @@ -541,9 +543,9 @@ def get_table( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -560,7 +562,9 @@ def get_table( return deserialized - get_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}"} # type: ignore + get_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}" + } def _create_update_table_initial( self, @@ -581,11 +585,11 @@ def _create_update_table_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.TableGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.TableGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -609,9 +613,9 @@ def _create_update_table_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -630,7 +634,9 @@ def _create_update_table_initial( return deserialized - _create_update_table_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}"} # type: ignore + _create_update_table_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}" + } @overload def begin_create_update_table( @@ -753,16 +759,16 @@ def begin_create_update_table( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TableGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TableGetResults] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_table_initial( # type: ignore + raw_result = self._create_update_table_initial( resource_group_name=resource_group_name, account_name=account_name, table_name=table_name, @@ -783,7 +789,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -795,9 +801,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_update_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}"} # type: ignore + begin_create_update_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}" + } def _delete_table_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, account_name: str, table_name: str, **kwargs: Any @@ -813,10 +821,10 @@ def _delete_table_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_table_request( resource_group_name=resource_group_name, @@ -829,9 +837,9 @@ def _delete_table_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -844,7 +852,9 @@ def _delete_table_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_table_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}"} # type: ignore + _delete_table_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}" + } @distributed_trace def begin_delete_table( @@ -874,13 +884,13 @@ def begin_delete_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_table_initial( # type: ignore resource_group_name=resource_group_name, @@ -899,7 +909,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -911,9 +921,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}"} # type: ignore + begin_delete_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}" + } @distributed_trace def get_table_throughput( @@ -945,10 +957,10 @@ def get_table_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] + ) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) request = build_get_table_throughput_request( resource_group_name=resource_group_name, @@ -961,9 +973,9 @@ def get_table_throughput( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -980,7 +992,9 @@ def get_table_throughput( return deserialized - get_table_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default"} # type: ignore + get_table_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default" + } def _update_table_throughput_initial( self, @@ -1001,11 +1015,11 @@ def _update_table_throughput_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1029,9 +1043,9 @@ def _update_table_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1050,7 +1064,9 @@ def _update_table_throughput_initial( return deserialized - _update_table_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default"} # type: ignore + _update_table_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default" + } @overload def begin_update_table_throughput( @@ -1174,16 +1190,16 @@ def begin_update_table_throughput( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_table_throughput_initial( # type: ignore + raw_result = self._update_table_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, table_name=table_name, @@ -1204,7 +1220,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1216,9 +1232,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_table_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default"} # type: ignore + begin_update_table_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default" + } def _migrate_table_to_autoscale_initial( self, resource_group_name: str, account_name: str, table_name: str, **kwargs: Any @@ -1234,10 +1252,10 @@ def _migrate_table_to_autoscale_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_table_to_autoscale_request( resource_group_name=resource_group_name, @@ -1250,9 +1268,9 @@ def _migrate_table_to_autoscale_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1271,7 +1289,9 @@ def _migrate_table_to_autoscale_initial( return deserialized - _migrate_table_to_autoscale_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + _migrate_table_to_autoscale_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale" + } @distributed_trace def begin_migrate_table_to_autoscale( @@ -1302,15 +1322,15 @@ def begin_migrate_table_to_autoscale( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_table_to_autoscale_initial( # type: ignore + raw_result = self._migrate_table_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, table_name=table_name, @@ -1329,7 +1349,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1341,9 +1361,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_table_to_autoscale.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale"} # type: ignore + begin_migrate_table_to_autoscale.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale" + } def _migrate_table_to_manual_throughput_initial( self, resource_group_name: str, account_name: str, table_name: str, **kwargs: Any @@ -1359,10 +1381,10 @@ def _migrate_table_to_manual_throughput_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ThroughputSettingsGetResults]] + ) + cls: ClsType[Optional[_models.ThroughputSettingsGetResults]] = kwargs.pop("cls", None) request = build_migrate_table_to_manual_throughput_request( resource_group_name=resource_group_name, @@ -1375,9 +1397,9 @@ def _migrate_table_to_manual_throughput_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1396,7 +1418,9 @@ def _migrate_table_to_manual_throughput_initial( return deserialized - _migrate_table_to_manual_throughput_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + _migrate_table_to_manual_throughput_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput" + } @distributed_trace def begin_migrate_table_to_manual_throughput( @@ -1427,15 +1451,15 @@ def begin_migrate_table_to_manual_throughput( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ThroughputSettingsGetResults] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_table_to_manual_throughput_initial( # type: ignore + raw_result = self._migrate_table_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, table_name=table_name, @@ -1454,7 +1478,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1466,9 +1490,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_migrate_table_to_manual_throughput.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore + begin_migrate_table_to_manual_throughput.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput" + } def _retrieve_continuous_backup_information_initial( self, @@ -1489,11 +1515,11 @@ def _retrieve_continuous_backup_information_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.BackupInformation]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BackupInformation]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1517,9 +1543,9 @@ def _retrieve_continuous_backup_information_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1538,7 +1564,9 @@ def _retrieve_continuous_backup_information_initial( return deserialized - _retrieve_continuous_backup_information_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/retrieveContinuousBackupInformation"} # type: ignore + _retrieve_continuous_backup_information_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/retrieveContinuousBackupInformation" + } @overload def begin_retrieve_continuous_backup_information( @@ -1658,16 +1686,16 @@ def begin_retrieve_continuous_backup_information( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-11-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-08-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupInformation] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackupInformation] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._retrieve_continuous_backup_information_initial( # type: ignore + raw_result = self._retrieve_continuous_backup_information_initial( resource_group_name=resource_group_name, account_name=account_name, table_name=table_name, @@ -1688,9 +1716,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1702,6 +1730,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_retrieve_continuous_backup_information.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/retrieveContinuousBackupInformation"} # type: ignore + begin_retrieve_continuous_backup_information.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/retrieveContinuousBackupInformation" + } 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 5049dc6363f6..0d7583acd458 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 @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCassandraKeyspaceCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 2c2faa10c25d..6edad27934a6 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(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCassandraKeyspaceDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 48b49c509f5c..222f87e18dd7 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCassandraKeyspaceGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 1c60ac488cca..f3f7675ae0fc 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCassandraKeyspaceList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 3fa579326f02..9c66f41e8376 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 edb565f49744..c9bbfc1ff9a0 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 9b433fd6972e..94a6ddc6c4bf 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCassandraKeyspaceThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 66c4b4cebfe6..6644fbbb4b3b 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 @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 487261df8fa6..ce3ea033e1ba 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 @@ -55,6 +55,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCassandraTableCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 2179c35b1715..31526514e0e6 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(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCassandraTableDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 23e8929a25a1..a5d8d699e27a 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCassandraTableGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 593ad835a554..953013ccdf50 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 @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCassandraTableList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 130d8dcea114..ee7f8e556733 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCassandraTableMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 d1b01ad4b179..bdad1b8bf5cb 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCassandraTableMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 1efabd83fb8a..2a625edf3065 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCassandraTableThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 f8d064398e8f..d8b36fa2a9cc 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 @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCassandraTableThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 index 9256e6689f41..4f4ee6858b64 100644 --- 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 @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCassandraViewCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-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 index ca2554b9dc5d..d440bdaf02dc 100644 --- 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCassandraViewDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-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 index 25aab6119622..042ae506e3fc 100644 --- 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCassandraViewGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-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 index 3958bb04cb03..e9e79b70119a 100644 --- 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 @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCassandraViewList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-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 index ebed72e4388c..ab4e2932fb72 100644 --- 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCassandraViewMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-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 index 570bbc9dfd82..07bdb7de233d 100644 --- 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCassandraViewMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-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 index 29387d15f5d5..ee7312b2fb72 100644 --- 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCassandraViewThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-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 index fcb964c2ab75..9fb6c16b1473 100644 --- 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 @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCassandraViewThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-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 b8c2185375cc..9b1972e37cc6 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 @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCollectionGetMetricDefinitions.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 6edcc8c2d283..3d06c4c616eb 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 @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCollectionGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 89c3da2709e8..4f3da09a259a 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 @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBCollectionGetUsages.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 new file mode 100644 index 000000000000..23d012ada8c3 --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_get_metrics.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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_collection_partition_get_metrics.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.collection_partition.list_metrics( + resource_group_name="rg1", + account_name="ddb1", + database_rid="databaseRid", + collection_rid="collectionRid", + filter="$filter=(name.value eq 'Max RUs Per Second') and timeGrain eq duration'PT1M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T23:58:55.2780000Z", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 new file mode 100644 index 000000000000..2130507a6a89 --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_get_usages.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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_collection_partition_get_usages.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.collection_partition.list_usages( + resource_group_name="rg1", + account_name="ddb1", + database_rid="databaseRid", + collection_rid="collectionRid", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 new file mode 100644 index 000000000000..4960967a8e2c --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_region_get_metrics.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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_collection_partition_region_get_metrics.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.collection_partition_region.list_metrics( + resource_group_name="rg1", + account_name="ddb1", + region="North Europe", + database_rid="databaseRid", + collection_rid="collectionRid", + filter="$filter=(name.value eq 'Max RUs Per Second') and timeGrain eq duration'PT1M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T23:58:55.2780000Z", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBCollectionPartitionRegionGetMetrics.json +if __name__ == "__main__": + main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_cancel.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_cancel.py new file mode 100644 index 000000000000..c31029fa68f1 --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_cancel.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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/2022-11-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobCancel.json +if __name__ == "__main__": + main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_create.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_create.py index 4e126423aa74..6af101cc71ab 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_create.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_create.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobCreate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobCreate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_feed.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_feed.py index 2a362aa11fa2..25470d9ed08c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_feed.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_feed.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobFeed.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobFeed.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_get.py index 996d42772900..c45589c7620c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_pause.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_pause.py index ee65fc402d52..a2f1b6b40bb0 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_pause.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_pause.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobPause.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobPause.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_resume.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_resume.py new file mode 100644 index 000000000000..187a6d25ebcc --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_job_resume.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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/2022-11-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobResume.json +if __name__ == "__main__": + main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/data_transfer_service_create.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_create.py similarity index 93% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/data_transfer_service_create.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_create.py index ec9473f00721..182d881ba197 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/data_transfer_service_create.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_create.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python data_transfer_service_create.py + python cosmos_db_data_transfer_service_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, @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBDataTransferServiceCreate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBDataTransferServiceCreate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/data_transfer_service_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_delete.py similarity index 92% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/data_transfer_service_delete.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_delete.py index 1d0c93cc79b0..0fa8e7630364 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/data_transfer_service_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python data_transfer_service_delete.py + python cosmos_db_data_transfer_service_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, @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBDataTransferServiceDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBDataTransferServiceDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/data_transfer_service_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_get.py similarity index 92% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/data_transfer_service_get.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_get.py index 9effb49d7e09..ee061c5f09e8 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/data_transfer_service_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python data_transfer_service_get.py + python cosmos_db_data_transfer_service_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, @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBDataTransferServiceGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 bbb34e785a12..051787a95558 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 @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBDatabaseAccountCheckNameExists.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 0199e0d3c613..2db882da824a 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 @@ -90,6 +90,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBDatabaseAccountCreateMax.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 c229ddce40ff..de986d27f59b 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 @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBDatabaseAccountCreateMin.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 b27514d38133..fb4da0897fcf 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(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBDatabaseAccountDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 9a30100a86ed..7e4d512bea03 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(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 766936972666..1204ec2a0929 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 @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBDatabaseAccountGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 a438667d24ca..1b8dd414b07b 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 87f5d4daa216..07d7bece730b 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 @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBDatabaseAccountGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 a9de499c33c5..8ec69bf90220 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBDatabaseAccountGetUsages.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 b93a111c66ac..375c5a2d474e 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 @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBDatabaseAccountList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 449cc788063f..9ad9f4af1932 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 @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBDatabaseAccountListByResourceGroup.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 6909bb5b54e8..9a6e4bb3709c 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 @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBDatabaseAccountListConnectionStrings.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 9e4bfa630500..92fdbf4a6ce5 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 @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBDatabaseAccountListConnectionStringsMongo.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 626a31cbf760..803f9c33786b 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 @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBDatabaseAccountListKeys.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 10f830dfd54f..419cc232c2af 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 @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 3cb270a8fb77..8e2593cc1925 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(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBDatabaseAccountOfflineRegion.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 173357ccd562..70cabc6ca4de 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(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBDatabaseAccountOnlineRegion.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 66797a3621f3..e6a7652de634 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 @@ -80,6 +80,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBDatabaseAccountPatch.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 0ed9ce68f280..9c8208a86255 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(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBDatabaseAccountRegenerateKey.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 b4516d6827a2..691f0cb5ab29 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 @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBDatabaseAccountRegionGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 025e20a7d40f..54761daf327f 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 @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBDatabaseGetMetricDefinitions.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 756a8b660f23..10d19de8c870 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 @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBDatabaseGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 21a726ea3444..3c7161e0f986 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 @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBDatabaseGetUsages.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBDatabaseGetUsages.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/graph_api_compute_service_create.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_create.py similarity index 93% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/graph_api_compute_service_create.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_create.py index c3565bf74065..b74616fb6be2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/graph_api_compute_service_create.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_create.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python graph_api_compute_service_create.py + python cosmos_db_graph_api_compute_service_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, @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGraphAPIComputeServiceCreate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBGraphAPIComputeServiceCreate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/graph_api_compute_service_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_delete.py similarity index 92% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/graph_api_compute_service_delete.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_delete.py index 804281a9e8a1..8b1277e9471e 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/graph_api_compute_service_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python graph_api_compute_service_delete.py + python cosmos_db_graph_api_compute_service_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, @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGraphAPIComputeServiceDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBGraphAPIComputeServiceDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/graph_api_compute_service_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_get.py similarity index 92% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/graph_api_compute_service_get.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_get.py index db1974971dd1..82ea52ef1c2a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/graph_api_compute_service_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python graph_api_compute_service_get.py + python cosmos_db_graph_api_compute_service_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, @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGraphAPIComputeServiceGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBGraphAPIComputeServiceGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_create_update.py similarity index 93% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_create_update.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_create_update.py index 600417639f0a..87a9dff6dc1a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_create_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python cosmos_db_graph_create_update.py + 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, @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGraphResourceCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-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 new file mode 100644 index 000000000000..3d252a61c9e3 --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_delete.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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", + ) + + response = client.graph_resources.begin_delete_graph_resource( + resource_group_name="rg1", + account_name="ddb1", + graph_name="graphName", + ).result() + print(response) + + +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-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 new file mode 100644 index 000000000000..85dee5369a9d --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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/2022-11-15-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 new file mode 100644 index 000000000000..2261f8b72aa9 --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_list.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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/2022-11-15-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 bdf3168cb97e..f27792e6251d 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 @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGremlinDatabaseCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 d28bb6381127..6c4143c52b7c 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(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGremlinDatabaseDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 26d04a11c6c8..c39763096dfd 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGremlinDatabaseGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 0204ce3c1ab7..52129e466649 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGremlinDatabaseList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 6ff6e198c1fd..8b933f13fc5a 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 4b48eb4fd42b..c2c98e67e0e4 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 5f0e92e8e35d..5adf9404419d 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGremlinDatabaseThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 c00e7005f43a..aa6b11962ec8 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 @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGremlinDatabaseThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 4b626cb008d7..f90558bcd44d 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 @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGremlinGraphBackupInformation.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 e8718bad43b6..6b2a13a3f1b1 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 @@ -66,6 +66,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGremlinGraphCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 128d58de9cf6..fd34ca95e1c4 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(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGremlinGraphDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 00bb5ae50678..1964d724c77d 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGremlinGraphGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 3f58f1b55d2d..1aebc592916e 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 @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGremlinGraphList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 0487c91b2841..02fc2277cb83 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGremlinGraphMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 cddf819e1cd4..04391597dfa5 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 1af1cfa6f8f6..0a9795942f48 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGremlinGraphThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 e9ea71f596aa..40bccbae5422 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 @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGremlinGraphThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 5c98b01059cd..e10475021455 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 @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBLocationGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 c04a6b03802a..c8b89236ae9a 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 @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBLocationList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 3cc5534ac622..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_backup.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_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="subid", - ) - - 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/2022-08-15-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 0127a63effe3..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_backups_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_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="subid", - ) - - 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/2022-08-15-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 881d5f2d6f81..a57054dca57c 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 @@ -59,6 +59,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBManagedCassandraClusterCreate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 23cb98825a38..00ace7fa7d56 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 @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBManagedCassandraClusterDeallocate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 28437f0febd0..a37df54e50e8 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(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBManagedCassandraClusterDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 57541a09e5f8..23b09720ed22 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 @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBManagedCassandraClusterGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 8bb3e83c7b23..173a9df18eb9 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 @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 c71680887cb9..d891be02fa6a 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 @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBManagedCassandraClusterListBySubscription.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 ae13aef18625..998ac6e15d7d 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 @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBManagedCassandraClusterPatch.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 22d715993866..c11499709289 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 @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBManagedCassandraClusterStart.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 577cb1d36442..6ad23a86f9f5 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBManagedCassandraCommand.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBManagedCassandraCommand.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 541216f03ee8..055f8b6a913e 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 @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBManagedCassandraDataCenterCreate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 717401028c2d..f8aa5508a271 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(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBManagedCassandraDataCenterDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 c0af16e556fb..2acf0229beba 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBManagedCassandraDataCenterGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 cc2be45795f4..f31b73553c27 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBManagedCassandraDataCenterList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBManagedCassandraDataCenterList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_patch.py similarity index 94% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_update.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_patch.py index d75c7881eacb..1af56aa99506 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_patch.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python cosmos_db_managed_cassandra_data_center_update.py + python cosmos_db_managed_cassandra_data_center_patch.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, @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBManagedCassandraDataCenterPatch.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBManagedCassandraDataCenterPatch.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 9dc83208769f..2e4548f5f12e 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 @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBManagedCassandraStatus.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBManagedCassandraStatus.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/materialized_views_builder_service_create.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_create.py similarity index 92% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/materialized_views_builder_service_create.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_create.py index 142418d13f45..d75986f32d33 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/materialized_views_builder_service_create.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_create.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python materialized_views_builder_service_create.py + python cosmos_db_materialized_views_builder_service_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, @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/materialized_views_builder_service_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_delete.py similarity index 92% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/materialized_views_builder_service_delete.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_delete.py index 90c2982b5477..402dc3df9587 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/materialized_views_builder_service_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python materialized_views_builder_service_delete.py + python cosmos_db_materialized_views_builder_service_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, @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/materialized_views_builder_service_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_get.py similarity index 92% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/materialized_views_builder_service_get.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_get.py index ca0edbf69722..f48e1234af40 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/materialized_views_builder_service_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python materialized_views_builder_service_get.py + python cosmos_db_materialized_views_builder_service_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, @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 fdc10625f5d0..2eb8784c5c63 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 @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBCollectionBackupInformation.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 3ec2c6f32522..f07ea944997e 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(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBCollectionDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 714d9ee57d40..6a0e47086f45 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBCollectionGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 6a284eb791c9..b6577d5395ee 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 @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBCollectionList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 4c851a29e82e..ef1ad800f96f 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 b5dbc816b495..01b9382314c6 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 index 0ad136bdfed5..497ee0850aeb 100644 --- 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 @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBCollectionPartitionMerge.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-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 index 02776fbe4021..e9aebc3d15af 100644 --- 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 @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBCollectionRedistributeThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-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 index c44241a68e44..309127f250a1 100644 --- 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 @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBCollectionRetrieveThroughputDistribution.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-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 6be2e7b416a8..76fd267fd1dc 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBCollectionThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 665bd1799453..7af7a6a07e26 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 @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBCollectionThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 648baf9d53a3..5c438631aa0c 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(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBDatabaseDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 6592b3271f39..72b22ac5171c 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBDatabaseGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 9b649bb126b0..e41682eb2ead 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBDatabaseList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 a82f6959a837..a5f547c22ddb 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 b6d504fac13e..f51aadfcfd61 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.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 index 5ec7e2cc9179..f34c6f2d1524 100644 --- 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 @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBDatabaseRedistributeThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-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 index 30e8e1a5a281..964c27267aa1 100644 --- 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 @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBDatabaseRetrieveThroughputDistribution.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-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 bcdecc7e9c2b..7f015d004953 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBDatabaseThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 d1cd4235dd24..37eeadaf84fa 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 @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 2c827e1157c9..8bd7bd3ca7d3 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 @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 d1cd956896f3..95ce660816e4 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(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBRoleDefinitionDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBMongoDBRoleDefinitionDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_role_definition_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_get.py similarity index 93% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_role_definition_get.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_get.py index 7d3e03a7b38c..64b202aa34ec 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_role_definition_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python cosmos_db_mongo_role_definition_get.py + python cosmos_db_mongo_db_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, @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 c3c46817b496..248734e2a8c4 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBRoleDefinitionList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 7594fbc390f3..c340ea7635ec 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 @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 6c908b48c04c..8741187a982c 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(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBUserDefinitionDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 fc42a5dc3052..408e0199a06f 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBUserDefinitionGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 e15a54d77527..6e359542aac5 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBMongoDBUserDefinitionList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 a8eaa4395b70..23ed0e5aea5e 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(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBNotebookWorkspaceDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 091289c0221f..6c407d173e3e 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBNotebookWorkspaceGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 5b619fcaa06e..c36a75710df4 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBNotebookWorkspaceList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 a47185013597..83d733b8840c 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBNotebookWorkspaceListConnectionInfo.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 46037ff47d46..4d0ed945662f 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(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBNotebookWorkspaceRegenerateAuthToken.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 a98801a32b86..6eced414c5e0 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(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBNotebookWorkspaceStart.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 2898c2a5aa17..2f058ff42770 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 @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBOperationsList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 new file mode 100644 index 000000000000..919ed239f448 --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_get_metrics.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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_percentile_get_metrics.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.percentile.list_metrics( + resource_group_name="rg1", + account_name="ddb1", + filter="$filter=(name.value eq 'Probabilistic Bounded Staleness') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 new file mode 100644 index 000000000000..ac7561bb8003 --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_source_target_get_metrics.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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_percentile_source_target_get_metrics.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.percentile_source_target.list_metrics( + resource_group_name="rg1", + account_name="ddb1", + source_region="West Central US", + target_region="East US", + filter="$filter=(name.value eq 'Probabilistic Bounded Staleness') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 new file mode 100644 index 000000000000..42cd032bd1bc --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_target_get_metrics.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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_percentile_target_get_metrics.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.percentile_target.list_metrics( + resource_group_name="rg1", + account_name="ddb1", + target_region="East US", + filter="$filter=(name.value eq 'Probabilistic Bounded Staleness') and timeGrain eq duration'PT5M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBPercentileTargetGetMetrics.json +if __name__ == "__main__": + main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/deletes_a_private_endpoint_connection_with_a_given_name..py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_delete.py similarity index 92% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/deletes_a_private_endpoint_connection_with_a_given_name..py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_delete.py index 6449b6a607fa..c460cfc94e1a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/deletes_a_private_endpoint_connection_with_a_given_name..py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python deletes_a_private_endpoint_connection_with_a_given_name..py + python cosmos_db_private_endpoint_connection_delete.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBPrivateEndpointConnectionDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 new file mode 100644 index 000000000000..76bca649282a --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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_private_endpoint_connection_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = CosmosDBManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.private_endpoint_connections.get( + resource_group_name="rg1", + account_name="ddb1", + private_endpoint_connection_name="privateEndpointConnectionName", + ) + print(response) + + +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBPrivateEndpointConnectionGet.json +if __name__ == "__main__": + main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/gets_private_endpoint_connection..py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_list_get.py similarity index 92% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/gets_private_endpoint_connection..py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_list_get.py index 25833f8e030a..112b79b369c3 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/gets_private_endpoint_connection..py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_list_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python gets_private_endpoint_connection..py + python cosmos_db_private_endpoint_connection_list_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, @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBPrivateEndpointConnectionListGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBPrivateEndpointConnectionListGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/approve_or_reject_a_private_endpoint_connection_with_a_given_name..py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_update.py similarity index 92% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/approve_or_reject_a_private_endpoint_connection_with_a_given_name..py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_update.py index 7e91c1b11e3d..f584e53ccf8b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/approve_or_reject_a_private_endpoint_connection_with_a_given_name..py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python approve_or_reject_a_private_endpoint_connection_with_a_given_name..py + python cosmos_db_private_endpoint_connection_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, @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBPrivateEndpointConnectionUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 new file mode 100644 index 000000000000..86c05fb0c6df --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_link_resource_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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_private_link_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="00000000-1111-2222-3333-444444444444", + ) + + response = client.private_link_resources.get( + resource_group_name="rg1", + account_name="ddb1", + group_name="sql", + ) + print(response) + + +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 new file mode 100644 index 000000000000..a3d66987452e --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_link_resource_list_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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_private_link_resource_list_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-1111-2222-3333-444444444444", + ) + + response = client.private_link_resources.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/2022-11-15-preview/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 64cff2846fc9..bf88366b125d 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 @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBRegionCollectionGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 c8717b1563a0..c507ef8b6ff7 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 @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBRestorableDatabaseAccountGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 dcda84e1aa87..3573b21495f6 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 @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBRestorableDatabaseAccountList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 b168e54dfa16..9db3e7526e3c 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 @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 b3d4269723b3..84297327e696 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBRestorableGremlinDatabaseList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 cd4c82d3d0bf..cbe0fb7c134b 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBRestorableGremlinGraphList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 ca331435d932..c774f0c8cb16 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBRestorableGremlinResourceList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 8d1834f2288b..260d3ffd0969 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBRestorableMongodbCollectionList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 83af80146ddb..99a3b47f7820 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBRestorableMongodbDatabaseList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 1c067d3bd3bb..08b8244a31df 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBRestorableMongodbResourceList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 53acc41a5cb9..20c42d6332c8 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBRestorableSqlContainerList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 46fb5dbe27ef..4c9f494d1490 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBRestorableSqlDatabaseList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 1a9a16b7b498..145a85210cc0 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBRestorableSqlResourceList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 5efcfd312739..bd91e68b78ba 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBRestorableTableList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 ecd7570485ad..d6d97f3e81a0 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBRestorableTableResourceList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBRestorableTableResourceList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restore_database_account_create_update.json.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restore_database_account_create_update.py similarity index 95% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restore_database_account_create_update.json.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restore_database_account_create_update.py index 1d23fffaac60..793a4d982ac2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restore_database_account_create_update.json.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restore_database_account_create_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python cosmos_db_restore_database_account_create_update.json.py + python cosmos_db_restore_database_account_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, @@ -66,6 +66,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBRestoreDatabaseAccountCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 f6c4ce325a05..8beb788deca9 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBServicesList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBServicesList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_client_encryption_key_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_create_update.py similarity index 94% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_client_encryption_key_create_update.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_create_update.py index ed0095e21141..0e904eec92a3 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_client_encryption_key_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_create_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python cosmos_db_client_encryption_key_create_update.py + python cosmos_db_sql_client_encryption_key_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, @@ -53,6 +53,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_client_encryption_key_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_get.py similarity index 92% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_client_encryption_key_get.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_get.py index 214a3698462e..43537d68bf02 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_client_encryption_key_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python cosmos_db_client_encryption_key_get.py + python cosmos_db_sql_client_encryption_key_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, @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_client_encryption_keys_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_keys_list.py similarity index 92% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_client_encryption_keys_list.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_keys_list.py index 3797a7474be0..ef7754f16b73 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_client_encryption_keys_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_keys_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python cosmos_db_client_encryption_keys_list.py + python cosmos_db_sql_client_encryption_keys_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, @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlClientEncryptionKeysList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 e3b259b6092a..5ba287e30cea 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 @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlContainerBackupInformation.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 933ad6cbe8c7..89171b00c655 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 @@ -76,6 +76,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlContainerCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 bd49c792b268..aaea08246336 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(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlContainerDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 50edc08d2c6d..2cb8e70a6aa7 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlContainerGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 6965f91c95b8..35af6b9ab3ce 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 @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlContainerList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 83356d1e26c8..f241fe439e18 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlContainerMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 3e8ed45524df..8a43ea0d348b 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlContainerMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 index 01111c9169d8..877ad25111b9 100644 --- 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 @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlContainerPartitionMerge.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-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 index 6ab57e1b75b0..6924250dd236 100644 --- 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 @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlContainerRedistributeThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-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 index fb9454996829..e03f47b6eaf3 100644 --- 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 @@ -53,6 +53,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlContainerRestore.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-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 index 1e5c6831c9d5..92a4de93bdf6 100644 --- 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 @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlContainerRetrieveThroughputDistribution.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-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 f6e9e446e6b4..ab72f98fe4bd 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlContainerThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 2d348c3dd303..be16933d8d2c 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 @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlContainerThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 7fbd64d31c49..3df021c57738 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 @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlDatabaseCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 c07825ee2405..fe00ccd4c6ad 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 @@ -29,14 +29,14 @@ def main(): subscription_id="subid", ) - response = client.graph_resources.begin_delete_graph_resource( + response = client.sql_resources.begin_delete_sql_database( resource_group_name="rg1", account_name="ddb1", - graph_name="graphName", + database_name="databaseName", ).result() print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGraphResourceDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 f97c2b8f16b4..c3a9d3b8c218 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 @@ -29,14 +29,14 @@ def main(): subscription_id="subid", ) - response = client.graph_resources.get_graph( + response = client.sql_resources.get_sql_database( resource_group_name="rg1", account_name="ddb1", - graph_name="graphName", + database_name="databaseName", ) print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGraphResourceGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 8d282d994847..2d35e7bc1bd6 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 @@ -29,7 +29,7 @@ def main(): subscription_id="subid", ) - response = client.graph_resources.list_graphs( + response = client.sql_resources.list_sql_databases( resource_group_name="rgName", account_name="ddb1", ) @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBGraphResourceList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 ce97d4f7fce7..f8c68690e730 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 0cb09511e9a9..7d3c78c61345 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.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 index 91d1cb063f1b..93dd580ccc4f 100644 --- 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 @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlDatabaseRedistributeThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-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 index 33c1ca70322a..e9541abbbe22 100644 --- 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 @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlDatabaseRestore.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-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 index 033068f7d943..3663779427cf 100644 --- 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 @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlDatabaseRetrieveThroughputDistribution.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-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 de5d752b434f..88cdc9b16b44 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlDatabaseThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 b7fec03f48fb..446dc84bee7f 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 @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlDatabaseThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBSqlDatabaseThroughputUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/sql_dedicated_gateway_service_create.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_dedicated_gateway_service_create.py similarity index 93% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/sql_dedicated_gateway_service_create.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_dedicated_gateway_service_create.py index c84ac27f8fec..75e9c09459e6 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/sql_dedicated_gateway_service_create.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_dedicated_gateway_service_create.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python sql_dedicated_gateway_service_create.py + python cosmos_db_sql_dedicated_gateway_service_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, @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlDedicatedGatewayServiceCreate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBSqlDedicatedGatewayServiceCreate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/sql_dedicated_gateway_service_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_dedicated_gateway_service_delete.py similarity index 92% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/sql_dedicated_gateway_service_delete.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_dedicated_gateway_service_delete.py index 402f5d9e452a..1137a564e32f 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/sql_dedicated_gateway_service_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_dedicated_gateway_service_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python sql_dedicated_gateway_service_delete.py + python cosmos_db_sql_dedicated_gateway_service_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, @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlDedicatedGatewayServiceDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBSqlDedicatedGatewayServiceDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/sql_dedicated_gateway_service_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_dedicated_gateway_service_get.py similarity index 92% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/sql_dedicated_gateway_service_get.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_dedicated_gateway_service_get.py index 6fe8b6e12f94..9410bada928c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/sql_dedicated_gateway_service_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_dedicated_gateway_service_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python sql_dedicated_gateway_service_get.py + python cosmos_db_sql_dedicated_gateway_service_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, @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlDedicatedGatewayServiceGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBSqlDedicatedGatewayServiceGet.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 2ee81090c20d..d22b63e88ad2 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 @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 d2c7c1e3dad5..89a4d9d122f4 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(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlRoleAssignmentDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 1937a5ae8e67..33ca9b264ed3 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlRoleAssignmentGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 be07b3f4517d..bbb96e2ef583 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlRoleAssignmentList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 819d0dd174e5..0b9029869f11 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 @@ -56,6 +56,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 2b6acbd0e1af..9dd232b74102 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(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlRoleDefinitionDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 9b240ad3c8c2..b1538a23d06e 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlRoleDefinitionGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 bee9e0444493..1d10d43bc4e4 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlRoleDefinitionList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 0b40a12acd10..704580899872 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 @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlStoredProcedureCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 ef32462a697c..3830e8f4aace 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(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlStoredProcedureDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 e060a1fad014..f263bf44940d 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 @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlStoredProcedureGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 8877befe879d..8422768de071 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 @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlStoredProcedureList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 fbf745c3d79b..72950795bba7 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 @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlTriggerCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 e369f99a62cb..29070941e984 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(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlTriggerDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 1656e9353a79..7b8c324f3c4b 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 @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlTriggerGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 8fbacc07d4a3..8d08e5e62080 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 @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlTriggerList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 a19e1b51b097..be1411711b88 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 @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 138d5e1fe71c..2098de1520ff 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(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlUserDefinedFunctionDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 44e8b3ca453a..857b02222e86 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 @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 7cfb10330069..0bfa1f0afb59 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 @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBSqlUserDefinedFunctionList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBSqlUserDefinedFunctionList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_collection_backup_information.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_backup_information.py similarity index 92% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_collection_backup_information.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_backup_information.py index a6ed8773ba78..8dab457cdcf3 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_collection_backup_information.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_backup_information.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python cosmos_db_table_collection_backup_information.py + python cosmos_db_table_backup_information.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, @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBTableBackupInformation.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBTableBackupInformation.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_replace.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_create_update.py similarity index 93% rename from sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_replace.py rename to sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_create_update.py index 5f409dea1b25..b1337a65d62c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_replace.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_create_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-cosmosdb # USAGE - python cosmos_db_table_replace.py + python cosmos_db_table_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, @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBTableCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 5f536f7447bd..472e22adec4f 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(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBTableDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 ffc1a2ec8e4c..1c0f156b13bf 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBTableGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 54dfc2742582..0dcb1c4f5001 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBTableList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 5f32d06ff0af..a29577d6b9a8 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBTableMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 6c6a2e352e70..62dbdfa37891 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBTableMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 ef5cfd067f46..e2c58ba31a20 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBTableThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 b6b171903299..dfe138b98ed2 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 @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-08-15-preview/examples/CosmosDBTableThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 new file mode 100644 index 000000000000..3b4bed4b072d --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_dbp_key_range_id_get_metrics.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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_dbp_key_range_id_get_metrics.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.partition_key_range_id.list_metrics( + resource_group_name="rg1", + account_name="ddb1", + database_rid="databaseRid", + collection_rid="collectionRid", + partition_key_range_id="0", + filter="$filter=(name.value eq 'Max RUs Per Second') and timeGrain eq duration'PT1M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T23:58:55.2780000Z", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/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 new file mode 100644 index 000000000000..eab40158f4cb --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_dbp_key_range_id_region_get_metrics.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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_dbp_key_range_id_region_get_metrics.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.partition_key_range_id_region.list_metrics( + resource_group_name="rg1", + account_name="ddb1", + region="West US", + database_rid="databaseRid", + collection_rid="collectionRid", + partition_key_range_id="0", + filter="$filter=(name.value eq 'Max RUs Per Second') and timeGrain eq duration'PT1M' and startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T23:58:55.2780000Z", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-11-15-preview/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json +if __name__ == "__main__": + main()